bethskurrie
2018-03-26 01:16
has joined #pact-broker

bethskurrie
2018-03-29 19:57
/github subscribe pact-foundation/pact_broker issues

bethskurrie
2018-03-29 19:58
/github unsubscribe pact-foundation/pact_broker pulls

bethskurrie
2018-03-29 19:58
/github unsubscribe pact-foundation/pact_broker commits

bethskurrie
2018-03-29 19:58
/github unsubscribe pact-foundation/pact_broker statuses

bethskurrie
2018-03-29 20:22
/github unsubscribe pact-foundation/pact_broker public

bethskurrie
2018-03-29 22:13
added an integration to this channel: https://pact-foundation.slack.com/services/B9YEJCV19

bethskurrie
2018-03-29 22:14
removed an integration from this channel: https://pact-foundation.slack.com/services/B9YEJCV19

uglyog
2018-04-03 23:40
has joined #pact-broker

bethskurrie
2018-04-05 04:09
/github subscribe dius/pact_broker-docker

bethskurrie
2018-04-05 04:19
/github subscribe pact-foundation/pact_broker-client

bethskurrie
2018-04-05 04:28
added an integration to this channel: https://pact-foundation.slack.com/services/B9YEJPQQK

bethskurrie
2018-05-02 04:54
/github subscribe pact-foundation/pact_broker releases

bethskurrie
2018-05-02 04:55
/github unsubscribe pact-foundation/pact_broker deployments

sgleadow
2018-05-09 07:06
has joined #pact-broker

abubics
2018-05-09 07:10
has joined #pact-broker

brentbarker9
2018-05-09 20:57
has joined #pact-broker

bethskurrie
2018-05-10 03:52
/github unsubscribe DiUS/pact_broker-docker commits

bethskurrie
2018-05-10 03:52
/github unsubscribe DiUS/pact_broker-docker public

tjones
2018-05-15 01:05
has joined #pact-broker

mboudreau
2018-05-20 23:48
has joined #pact-broker

shekharsp27
2018-05-23 05:20
has joined #pact-broker

gopinathlangote11
2018-05-23 13:31
has joined #pact-broker

gnewitt
2018-05-29 22:48
has joined #pact-broker

matt.fellows
2018-06-02 12:19
has joined #pact-broker

hstene
2018-06-02 13:09
has joined #pact-broker

dlucas
2018-06-05 09:33
has joined #pact-broker

richard.peckett
2018-06-07 08:22
has joined #pact-broker

mr.matt.r.long
2018-06-08 14:03
has joined #pact-broker

gonzalogarcia243
2018-06-08 14:59
has joined #pact-broker

matt
2018-06-11 01:39
has joined #pact-broker

bethskurrie
2018-06-11 11:28
/github subscribe pact-foundation/pact_broker releases

mr.matt.r.long
2018-06-11 15:18
@bethskurrie would you be able to point me out how to add authentication to my broker? Probably being blind, but can't see anything in the docs

bethskurrie
2018-06-11 21:33
There's no built in auth @mr.matt.r.long, but you can wrap basic auth around it. I'd recommend using the docker image. Proper auth is the first item on our DiUS hosted broker roadmap, but we haven't had time to pick it up (it's a bit of a background project).


matt.fellows
2018-06-11 21:54
One simple strategy is to add another docker container (e.g. nginx) as a proxy to the broker, and add auth there. Then you only expose the broker port to the proxy container.

mr.matt.r.long
2018-06-12 07:55
Righto, thanks for the help @bethskurrie & @matt.fellows I'll look into it. We're already using the Docker images, so shouldn't be too much effort

mr.matt.r.long
2018-06-12 09:11
Do either of you @bethskurrie or @matt.fellows know the best approach to handling executions from dev machines vs CI. Mainly how to prevent dev builds from populating results on the broker. Was thinking that potentially the basic auth itself on the broker would be able to handle this, in that it the creds are not available on the local builds then the results publishing wouldn't be successful. My only concern here would be if the provider builds remains successful with the 400 responses from the broker. Do you guys have any experience resolving this, or an alternative approach?

bethskurrie
2018-06-12 10:04
Funny @mr.matt.r.long, I was just talking to @uglyog about this yesterday. How you handle this depends on which implementation you're using. Which language are you on?

mr.matt.r.long
2018-06-12 10:05
I'm in process of introducing Pact to my new team. They're largely JVM based, but there's one Go client too

bethskurrie
2018-06-12 10:05
The high level theory is that the pact tests should run as part of your standard build, but the pact publication should be a separate task that only runs on your CI. The pact verification should run as part of your standard provider build, but the publication should be turned off by default, and only turned on in your CI environment, generally by checking for some environment variable.

bethskurrie
2018-06-12 10:06
Unfortunately, pact-jvm has a bug whereby it publishes verifications automatically. I've just raised an issue to have that changed.

bethskurrie
2018-06-12 10:07
You'll need to work out if there's a way you can configure it to be off by default, and only on when you set a certain property or environment variable.

bethskurrie
2018-06-12 10:07
(Sorry, I'm not a java person, so I'm not sure how the configs work)


bethskurrie
2018-06-12 10:09
It only publishes contracts when the tests pass, and the publish is only called on the CI.


bethskurrie
2018-06-12 10:10
(Sorry they're in Ruby, not java, but you'll get the general picture)


bethskurrie
2018-06-12 10:14
I think I'll add a bit on only publishing from CI, thanks to your question.

mr.matt.r.long
2018-06-12 10:26
Awesome thanks for the help. I'll look into what options that I have using the JVM plugins that we're currently trialling, on the consumer side there's a MVN cmd to publish the pact so we can make sure that's only run from CI although I'd like to look into a programatic way to ensure that a developer can't accidentally run it, I'm thinking the broker Auth should handle that. On the Spring Provider plugin it does automatically publish the verification results, there is a workaround in that it won't if the Provider version isn't supplied, so this is an option I can look. Thanks again :thumbsup:

abhilash.hanumanth
2018-06-12 14:26
has joined #pact-broker

mmonson
2018-06-12 20:02
has joined #pact-broker

gbeckmann
2018-06-12 20:43
has joined #pact-broker

richard.peckett
2018-06-13 17:05
peeps is there a quick way to delete a pact from the broker?


bethskurrie
2018-06-13 21:07
There's a open issue for someone to add a button to the UI.

richard.peckett
2018-06-14 09:16
Cheers Beth :thumbsup: :star: as always

slack1
2018-06-16 06:31
has joined #pact-broker

abhilash.hanumanth
2018-06-16 10:08
I ran the pact-jvm consumer tests and published the pact file to a pact broker hosted locally in my system. Now, I am running the pact-jvm provider tests and Last verified column is empty but the provider test is successful. Can someone tell me what could be the reason ?

abhilash.hanumanth
2018-06-16 10:20
My provider code is like this : ``` import au.com.dius.pact.provider.junit.PactRunner; import au.com.dius.pact.provider.junit.Provider; import au.com.dius.pact.provider.junit.VerificationReports; import au.com.dius.pact.provider.junit.loader.PactBroker; import au.com.dius.pact.provider.junit.target.HttpTarget; import au.com.dius.pact.provider.junit.target.Target; import au.com.dius.pact.provider.junit.target.TestTarget; import lombok.extern.slf4j.Slf4j; import org.junit.runner.RunWith; @Slf4j @RunWith(PactRunner.class) @Provider("controllerProvider") @PactBroker(host = "localhost", port = "2001") @VerificationReports(value = {"console", "markdown"}, reportDir = "target/reports") public class JavaAgentControllerProvider { private static final String HOST = "localhost"; private static final int PORT = 8777; @TestTarget public final Target target = new HttpTarget("http", HOST, PORT); } ```

matt.fellows
2018-06-16 10:34
What version of Pact JVM are you using @abhilash.hanumanth?


matt.fellows
2018-06-16 10:39
Could you also please post any relevant logs?

abhilash.hanumanth
2018-06-16 10:49
@matt.fellows: I am using this version of pact-jvm-provider-junit in provider tests : ```testCompile 'au.com.dius:pact-jvm-provider-junit_2.12:3.5.17'```

abhilash.hanumanth
2018-06-16 12:52
@matt.fellows: For some reason, my provider version is empty in the Matrix.

abhilash.hanumanth
2018-06-16 13:30
can someone tell me how to set provider version ? In docs, it says using `pact.provider.version` system property. How and where do I set this system property in provider junit test ?

thomas.heilbronner
2018-06-16 14:56
has joined #pact-broker

2018-06-16 15:19
@abhilash.hanumanth commented on @abhilash.hanumanth?s file https://pact-foundation.slack.com/files/UAT4VE1UK/FB8810ASD/image.png: The same is working in pact-jvm 3.5.12 but not working in pact-jvm 3.5.17. Can someone tell me is there any change publishing the verification results of pact to pact broker ?

abhilash.hanumanth
2018-06-16 15:28
The same is working till pact jvm 3.5.16

abhilash.hanumanth
2018-06-16 15:30
Last verified column is not populated in pact jvm 3.5.17 but gets populated in 3.5.16 pact jvm.

matt.fellows
2018-06-16 21:35
You could use `System.setProperty(...)` or, more appropriately during CI builds, use the standard `-D` flags to the java command running it

uglyog
2018-06-17 00:19
@abhilash.hanumanth there is a defect in 3.5.17, see https://github.com/DiUS/pact-jvm/issues/694

mngau
2018-06-17 01:27
has joined #pact-broker

thadir
2018-06-17 20:02
has joined #pact-broker

abhilash.hanumanth
2018-06-18 06:06
Thanks @matt.fellows

kevin.meiresonne
2018-06-19 06:56
has joined #pact-broker

rlamb
2018-06-19 21:10
has joined #pact-broker

rlamb
2018-06-19 21:10
Where do I find the doc on how to add users with basic auth to the pact-broker-docker?


rlamb
2018-06-19 21:25
Thanks, @matt.fellows!

matt.fellows
2018-06-19 22:07
no probs!

shekharsp27
2018-06-20 13:46
Hi, while creating a webhook I am getting an error { "errors": { "request.http_method": [ "must be POST. See /doc/webhooks#whitelist for more information." ], "request.url": [ "scheme must be https. See /doc/webhooks#whitelist for more information." ] } } I have observed that there is a hint to add this in "whitelist" could you please help me how to add. As for Jenkins webhook it works only with "GET" method (This is what I have observed). Also to test the webhook locally I need scheme as "http"

bethskurrie
2018-06-21 03:13
@shekharsp27 Did you look at the URL that it told you to read for more information?

bethskurrie
2018-06-21 03:24
Have you tried looking at the documentation for the Pact Broker? https://github.com/pact-foundation/pact_broker/wiki

bethskurrie
2018-06-21 03:36
I'd recommend reading the Configuration page.

shekharsp27
2018-06-21 05:26
@bethskurrie Thanks, looks like I have missed that :disappointed:

bethskurrie
2018-06-21 23:47
Hi all. One of the main things people don't like about the current implementation of CDC that Pact provides is the ability of a consumer to break a provider's build by pushing new or incorrect expectations to the Pact Broker. I've been thinking of a fairly simple solution to "protect" the provider build, by allowing a configuration option that basically says "you can't tag a pact as `master` (configurable tag name) until it has been verified by the `master` (configurable tag name) version of the provider". The way this would work is that the consumer team would publish a new pact with a non-master tag name, and once the provider had implemented the new feature, and published a verification for that pact content from the `master` branch of the provider, then that feature pact would be allowed to be tagged with master. This all pivots around the fact that the verifications belong to the pact *content* rather than the consumer version.

bethskurrie
2018-06-22 00:04
The only problem I see with this solution is that at some stage, a verification will have to be published from the master provider branch for the new content, and this should come from the CI - we don't want to have to have a developer manually verifying the feature pact from the master branch from their developer machine. So I'm thinking of introducing the concept of "wip" pacts - verifications that can run that are expected to fail, and won't fail the build if they fail. We could use tags for this, and if it works, perhaps introduce it as a higher level concept. I imagine the provider build verifying the `master` and `prod` pacts (fetched dynamically from the broker) and failing if the pacts fail, and also, verifying any `wip` pacts that do not already have a successful verification from master (again, fetched dynamically from the broker) but NOT failing if the verification fails.

bethskurrie
2018-06-22 00:06
If you're using webhooks to send git commit statuses for your pacts, this means that the "pact verification status" for a commit on a branch will go green automatically once the provider has successfully verified the new pact.

bethskurrie
2018-06-22 00:07
I'd love some feedback on this design from our Pact Broker users, new and old. I'm pretty sure you'll have some thoughts @cfmack @kevin.meiresonne @matt.fellows @uglyog

cfmack
2018-06-22 00:08
has joined #pact-broker

uglyog
2018-06-22 00:23
This is a good idea, but the main concern would be the complexity in the process. Let's not re-use the tags for this purpose. A higher level concept would be better, maybe a status associated with the pacts and verifications defined a workflow that would allow it to be easy to understand why things are happening.

bethskurrie
2018-06-22 01:05
@uglyog you're right about not re-using tags. I'd like to use it to prove the concept with some of our users, before I invest in making it a higher level concept however. We could do it with almost no coding change.

ragarwal
2018-06-22 01:22
has joined #pact-broker

ragarwal
2018-06-22 01:34
if verifications are not verified at provider side, it should stop consumer from deploying the code to master.

ragarwal
2018-06-22 01:35
we have similar situation in our project. We use git branches and want to make sure we can?t commit breaking changes to either consumer or provider side.

ragarwal
2018-06-22 01:39
Our consumers are publishing pacts tagged by branch name. ex `wip` if that is my branch. When we push the code changes on consumer branch build, it publishes new pact with tag `wip` and verify it against provider `master`. If build passes, it means provider is still full-filling all the consumer expectations and good to deploy the consumer code.

ragarwal
2018-06-22 01:39
else, it will fail the consumer build. We are not doing anything with provider build in this case.

ragarwal
2018-06-22 01:41
to implement consumer?s new expectations, we create `wip` branch at provider side and add the code. When we push the provider code, it will search for pacts tagged with `wip` and verify them. If everything is good, we merge the provider branch to master. Now we have new changes in provider master branch.

ragarwal
2018-06-22 01:42
if consumer build will run now, it will pass and can be merged to master.

bethskurrie
2018-06-22 01:42
@kevin.meiresonne I think this is pretty much what you're doing.


bethskurrie
2018-06-22 06:17
I've released consumer only/provider only/global webhooks in the latest version of the Pact Broker 2.23.0 (and the docker version 2.23.0-1). I've also released an update to the pact broker client that allows you to take a curl command to trigger a build (eg `curl https://ci.foo.org/builds -X POST -d {"foo": "bar"}`) and add a few params to save it as a webhook (eg `pact-broker create-webhook https://ci.foo.org/builds -X POST -d {"foo": "bar"}' --provider Foo --contract-content-changed`)

bethskurrie
2018-06-22 06:19
The following template variables are available now: ``` ${pactbroker.consumerName} ${pactbroker.providerName} ${pactbroker.consumerVersionNumber} ${pactbroker.providerVersionNumber} ${pactbroker.consumerVersionTags} ${pactbroker.providerVersionTags} ${pactbroker.githubVerificationStatus} ${pactbroker.pactUrl} ${pactbroker.verificationResultUrl} ``` Just a reminder that you can send pact verification commit statuses to github now. You can find a template for the request here: https://github.com/pact-foundation/pact_broker/wiki/Webhook-template-library

bethskurrie
2018-06-22 06:21
@jonas.lergell the official release is out now

jonas.lergell
2018-06-22 06:21
has joined #pact-broker

bethskurrie
2018-06-22 06:24
@richard.jones ^^ regarding consumer only/provider only/global webhooks

richard.jones
2018-06-22 06:24
has joined #pact-broker

kevin.meiresonne
2018-06-22 06:51
That's indeed very close to what we're doing as well

kevin.meiresonne
2018-06-22 06:56
Are these new variables already available on the hosted broker?

bethskurrie
2018-06-22 07:33
Yes

kevin.meiresonne
2018-06-22 08:20
Still processing this idea in my head, but it sounds interesting. In our case our "master" is not called "master" though, so we'd have to change that in order to benefit from this.

kevin.meiresonne
2018-06-22 08:22
Just a bit concerned if it would break our own workflow, which is already in place and very close to what @ragarwal describes in the blog post.

bethskurrie
2018-06-22 08:23
Master == configurable tag name.

bethskurrie
2018-06-22 08:24
It was just my example.

kevin.meiresonne
2018-06-22 08:24
Tbh, I don't mind having to implement this workflow ourselves, since I can imagine it differs from case to case

bethskurrie
2018-06-22 08:24
I see this as supporting the branch workflow quite well.

kevin.meiresonne
2018-06-22 08:25
yeah, I think it does, just a bit concerned about the "not being allowed to tag a pact as "master""-bit

kevin.meiresonne
2018-06-22 08:26
so if you'd decide to implement this logic, I'd keep it optional

bethskurrie
2018-06-22 08:26
It would enforce what you already do manually, which is to ensure the provider can successfully verify a pact on a branch before you tag a pact as master.

kevin.meiresonne
2018-06-22 08:27
the learning curve of pact and the broker is already quite steep, and you don't want people to pull their hairs out trying to figure out why they can't tag a pact

kevin.meiresonne
2018-06-22 08:27
well, actually we don't stop the provider nor consumer to be already tagged as master

bethskurrie
2018-06-22 08:28
Yes, it is. There would obviously have to be very clear feedback built in.

kevin.meiresonne
2018-06-22 08:28
we use the badges as a verification tool

kevin.meiresonne
2018-06-22 08:28
(and the matrix)

bethskurrie
2018-06-22 08:28
Most people are quite upset about consumers breaking provider builds. This would turn that around.

bethskurrie
2018-06-22 08:29
While giving the consumer a mechanism to make proposed changes.

kevin.meiresonne
2018-06-22 08:31
true


kevin.meiresonne
2018-06-22 08:31
but it could cause issues when a CI is setup differently and it does allow consumers to push to master before provider

kevin.meiresonne
2018-06-22 08:32
which might sound weird, but it could just be their way of working

kevin.meiresonne
2018-06-22 08:32
I mean, its often the chicken or the egg

bethskurrie
2018-06-22 08:33
Every ci is different!

kevin.meiresonne
2018-06-22 08:34
we have for instance a BFF pattern (backend-for-frontend). Now, if we need to make a breaking change for the consumer of the backend, it doesn't really matter which one is pushed first to master

kevin.meiresonne
2018-06-22 08:34
if you push provider first, the latest master of the consumer won't work until it's pushed to master as well

kevin.meiresonne
2018-06-22 08:34
and vice versa

thadir
2018-06-22 08:35
This could work, but the WIP should then be implemented in the PACT clients (as in I need to tell pact-jvm on the publish step and on the verify step trough a parameter that its in a branch.) (now ill start reading the whoel thread :wink:

bethskurrie
2018-06-22 08:35
My recommended workflow is to always push new changes to a non master tag, wait til the provider has verified it successfully on master then merge the consumer branch in.

kevin.meiresonne
2018-06-22 08:35
it's different for a provider functioning as a general purpose api for instance, that needs to guarantee backwards compat

kevin.meiresonne
2018-06-22 08:36
Yeah, that's indeed what we are moving to as well Beth

kevin.meiresonne
2018-06-22 08:36
makes more sense

kevin.meiresonne
2018-06-22 08:38
what would you consider a "wip" pact? Is this any pact not tagged with "master" or "prod"?

bethskurrie
2018-06-22 08:39
Yes @thadir we'd need to add the ability to say "try verifying all the wip pacts that don't have a successful verification already, but don't fail the build if they fail" to the verification configuration code.

thadir
2018-06-22 08:42
I think this could work prity wel. Am at the point that I wanna revisit the pact configuration and pact steps in our CI so that I can actealy start tagging pacts at versions. And Also wana remove pact versions thats are stale. I atm dont tacg the provider that verifies the consumer. Bc it will always break if it doesnt setifies them all. And with WIP I can actealy use the matrix to also see what is in porduction and not. (seeing when its build it will go to production). So im in for this one

bethskurrie
2018-06-22 08:48
@thadir what do you mean about not tagging, because will always break?

bethskurrie
2018-06-22 08:49
You should be able to see what is in production already.

thadir
2018-06-22 08:51
Hmm, atm any contract change from the consumer will break the provider. And not vise versa witch can be somtimes a problem. Its on my 2 do list to have some sort fo flow working that when a consumer builds on master it should be aible to check if the provider can verify there contract. And yes I can see it but (im a bit behind using all the features i am aible to version tag consumers in my ci but the provider part is messed up).

matt.fellows
2018-06-22 08:55
@matt.fellows pinned a message to this channel.

bethskurrie
2018-06-22 09:16
Yeah, the provider tags need to be used to get the real value from the matrix.

bethskurrie
2018-06-22 09:17
You can use the can-i-deploy tool to check the verification status of a pact from the consumer build. That's exactly what it's for.

bethskurrie
2018-06-22 09:18
If the contract hasn't changed since the last successful verification, it will come back true.

bethskurrie
2018-06-22 09:20
If you haven't read the Pact Nirvana document, this should help clarify how to use set up the tags in conjunction with can-i-deploy https://docs.google.com/document/d/e/2PACX-1vRf1kSDccImNipOOm1G-bjcSs-ifbZjf1v54K-dIcq8BLKeFPAAm_bf_p71UKqkRMIx30QWWL-kN8TI/pub

bethskurrie
2018-06-22 09:20
The doc is pretty ugly because it's still a WIP, and I've just published it from my google doc.

kevin.meiresonne
2018-06-22 09:31
@bethskurrie, if these changes would be implemented, if I understand correctly, then the following workflow would no longer break the provider build

kevin.meiresonne
2018-06-22 09:31
ah shoot, I can't paste images here


abubics
2018-06-22 10:15
I love the idea of wip pacts... A problem I've hit recently is feature branches that forgot to update the version number on their first commit breaking the previous pact version

abubics
2018-06-22 10:15
Totally, tags are a very flexible workaround tool ;D

bethskurrie
2018-06-22 10:33
Latest best practise is to always use or include the git sha dynamically in the version number. That should help you avoid that situation.

bethskurrie
2018-06-23 11:02
Actually, the more I think about the wip feature, the more I think, we don't need any change on the consumer side - we just need to add a "pb:wip-pacts-for-provider" relation/resource to the broker, and add code into the verification clients to say "don't fail the task if these verifications fail".

bethskurrie
2018-06-23 11:04
A "wip pact" would be a "latest tagged" pact that didn't yet have a successful verification.

bethskurrie
2018-06-23 11:05
This means the consumer team can push *any* new pact with a non-master tag, and get a verification result without breaking the provider build. If the new pact happens to pass without any changes being made to the codebase, then they can merge/promote (whatever their workflow is) that pact to "master" (or equivalent name), without the provider team having to do any work. This means that when the pact does become a "master" pact, it will be pre-verified, and the consumer can go straight into prod.

bethskurrie
2018-06-23 11:07
@matt.fellows I think this might achieve that no-waiting pipeline you were thinking of.

bethskurrie
2018-06-23 11:08
@uglyog ^^

bethskurrie
2018-06-23 11:09
This would involve almost no action on either the consumer/provider team's behalf, which should address @kevin.meiresonne?s concern that we need to keep it simple.

richard.jones
2018-06-24 22:45
ty!

kevin.meiresonne
2018-06-25 07:21
What's the format of the consumerVersionTags/providerVersionTags variables?

bethskurrie
2018-06-25 07:30
It's in the HAL docs

bethskurrie
2018-06-25 07:30
Click on the doc icon for the pb:webhooks relation in the HAL browser

bethskurrie
2018-06-25 07:31
I'm open to adding other formats too.

kevin.meiresonne
2018-06-25 07:39
that's fine for me. Just a question: I currently resolve the tags by calling describe-version from within our build pipeline. If I understand correctly, this is now redundant and I can just use this variable instead?

bethskurrie
2018-06-25 07:54
It will give you the tags, but it won't tell you if it is the latest of that tag. I should make another var that only has the names of the tags for which this pact is the latest.

kevin.meiresonne
2018-06-25 07:56
so describe-version will give the latest?

bethskurrie
2018-06-25 07:59
I think it's got a flag on the tag to say whether or not it's the latest.

bethskurrie
2018-06-25 08:00
Look at the JSON view of the response

kevin.meiresonne
2018-06-25 08:01
Hmm, don't see that flag

kevin.meiresonne
2018-06-25 08:01
just get a name and href

bethskurrie
2018-06-25 08:12
OK, it must be the matrix JSON I'm thinking of

kevin.meiresonne
2018-06-25 11:28
Hi, I have a rather urgent issue with the hosted broker. It looks like our webhooks no longer work. Pact broker returns a statuscode 500 now. I've tested and verified the http request using postman to be sure it's not related to our build server. Recreating the webhook in the broker also didn't help. Can somebody from DIUS have a look at it? @matt.fellows @bethskurrie

bethskurrie
2018-06-25 11:30
Hello

bethskurrie
2018-06-25 11:31
Looking at it now

bethskurrie
2018-06-25 11:37
@kevin.meiresonne click on the webhook status cell in the menu

bethskurrie
2018-06-25 12:41
if you are using webhooks with headers, please upgrade to 2.23.2 (docker tag 2.23.2-1) as there was a bug found in 2.23.1 where the configured headers weren't being used when executing the webhook.

bethskurrie
2018-06-25 12:44
Thanks to @kevin.meiresonne for identifying it!

kevin.meiresonne
2018-06-25 12:45
Thanks to @bethskurrie for fixing it ! :slightly_smiling_face:

kevin.meiresonne
2018-06-25 15:52
Anyone else having issues with the hosted pact broker being unavailable atm?

kevin.meiresonne
2018-06-25 15:52
We're getting this on the matrix, and 504's on the broker home page

bethskurrie
2018-06-25 22:02
Hi @kevin.meiresonne I'll look into that.

bethskurrie
2018-06-25 22:04
It seems to be up again. I think it was temporarily down while the kubernetes pods were rebalanced

bethskurrie
2018-06-25 22:04
There is work in progress already to improve our deployment process.

matt.fellows
2018-06-25 22:04
There was definitely a scaling even that seems to be over about 2am AEST

bethskurrie
2018-06-25 22:08
The quickest way is to open the URL in the HAL API browser and sent it a DELETE request.

kevin.meiresonne
2018-06-26 05:45
A delete request to where?

bethskurrie
2018-06-26 05:52
Sorry @kevin.meiresonne I replied on the wrong thread.

liran.tal
2018-07-05 05:23
has joined #pact-broker

matt.fellows
2018-07-05 07:25
Please let us know if you?re experiencing issues with your broker

mr.matt.r.long
2018-07-05 13:38
Hi all, I have a question regarding the best practise use of the can-I-deploy cli cmd. If the Pact's have not been verified yet (perhaps they've just been published during the build), should the can-i-deploy *fail* the deploy step within the CI process? I would prefer that the deploy waits until it is verified, then either pass/fail the build appropriately. Anyone else overcome this? I'm primarily thinking of deploys to an integration environment, rather than production (at the minute). Also worth pointing out Im using Teamcity.

bethskurrie
2018-07-05 21:36
This is a really good question. If you're expecting the verification to happen within a few minutes, you could try polling with a time out to wait until the result comes back.

bethskurrie
2018-07-05 21:38
You should only have to do this when the pact content has changed - most of the time it will be pre-verified.

bethskurrie
2018-07-05 21:40
Did we chat about this on github? If we didn't, there's a new feature in the latest broker that will allow you to determine if you're waiting for a result still, or if it has failed.


bethskurrie
2018-07-05 21:44
I'd recommend that you write a little script that would poll for a given amount of time while there was an unknown result, and then pass or fail, based on the verification result. If this works for you, I might add it into the command itself.

gaurav
2018-07-08 22:41
has joined #pact-broker

bethskurrie
2018-07-09 11:20
@mr.matt.r.long I've added retries to the can-i-deploy for unknown results. Can you please try it and tell me how it goes? https://github.com/pact-foundation/pact_broker-client#can-i-deploy


bethskurrie
2018-07-09 11:29
@bethskurrie pinned a message to this channel.

mr.matt.r.long
2018-07-09 11:37
Sorry Ive been away for a while. Thanks for the help on that, I'll let you know when I've had a chance to look into it.

bethskurrie
2018-07-09 11:38
Ta!

bsayers
2018-07-11 08:01
has joined #pact-broker

bethskurrie
2018-07-11 22:49
Hi all. I've added a Set up checklist for setting up a new integration to be tested using the Pact Broker. You can find it on the Pact Broker wiki (along with a heap of other useful info on the Pact Broker): https://github.com/pact-foundation/pact_broker/wiki/Set-up-checklist

matt.fellows
2018-07-11 22:52
This is great Beth!

bethskurrie
2018-07-11 22:53
Ta. Just adding a link to it in http://docs.pact.io

matt.fellows
2018-07-11 22:54
The only comment I have is that I thought you were about to demo how to integrate other things to it. E.g. web hooks

matt.fellows
2018-07-11 22:54
It's really the pipeline getting started, or best practices guide

bethskurrie
2018-07-11 22:55
Oh, right. Yeah, I meant consumer/provider.

bethskurrie
2018-07-11 23:37
The time limit for allowing a post to be edited is really short!

matt.fellows
2018-07-12 23:12
@mouser @andrewcfitzgerald I?m going to close down the other slack workspace now in favour of this - goodbye and hello :smile:

mouser
2018-07-12 23:12
has joined #pact-broker

andrewcfitzgerald
2018-07-12 23:12
has joined #pact-broker

ssn899
2018-07-17 17:09
has joined #pact-broker

ssn899
2018-07-17 17:13
~Does the docker version of pact-broker require UID or GID root(0) access? I am trying to run it on my company's servers, and they disallow such access. Is there anyway to get around that?~

ssn899
2018-07-17 18:07
I am trying to write a dockerfile from the pact-broker image. How might I go about that? Also what are the permissions needed by the broker?


ssn899
2018-07-17 21:35
I did just after I posted that question. It seems that the broker needs greater permission than 7447 (as mandated by security).

matt.fellows
2018-07-17 21:44
Permission on what? If you like, it's just a regular Ruby app so you can just create your own image and start it however you like. Or you could look at using http://pact.dius.com.au

bethskurrie
2018-07-18 00:48
@ssn899 can you explain that more? What permissions does it need?

bethskurrie
2018-07-18 00:58
I run it in my local machine without any special permissions, so I'm not sure what you're talking about. If there is something that needs changing, I'm happy to do it.

bethskurrie
2018-07-18 00:58
We run a modified version of the broker image on a kube stack without any special permissions too.

ssn899
2018-07-18 19:21
When I asked, I did not totally know what I needed. Sorry about that! So let me start again. What I am trying to accomplish is to host the Pact broker internally. (Security is here is pretty strict so http://pact.dius.com.au/ would not work. ) So to host in our own data center, root can not be used within the container. So I am creating a dockerfile based on dius/pact-broker to meet these security requirements. It seems that when starting the container, the broker runs `/sbin/my_init`, which I believe requires root. So I get the following error ``` Traceback (most recent call last): File "/sbin/my_init", line 414, in <module> main(args) File "/sbin/my_init", line 331, in main export_envvars() File "/sbin/my_init", line 114, in export_envvars with open("/etc/container_environment.sh", "w") as f: PermissionError: [Errno 13] Permission denied: '/etc/container_environment.sh' ``` (Ignore the whole 7447 thing, I was confused lol)

ssn899
2018-07-18 20:27
Wait ignore above, I think I fixed it. Sorry about that! :slightly_smiling_face:

bethskurrie
2018-07-19 02:25
:+1:

bethskurrie
2018-07-20 04:43
I just had a talk with an ex workmate who refused to use pact because of the ability of the consumer team to break the provider builds. I'm even more convinced of the usefulness of the wip pacts and the "build protection" features now.

bethskurrie
2018-07-20 04:44
I've been musing on whether I'd done the right design, but I think I just need to ship it and find out.

mboudreau
2018-07-20 04:47
build protection, yeah, I can see that

mboudreau
2018-07-20 04:47
but I think the main thing is changing the vision/mentality. It's not consumer driven anymore, it's collaborative

mboudreau
2018-07-20 04:47
I think there needs to be a healthy tension between the two, and both should be in agreement to be in compliance

matt.fellows
2018-07-20 07:03
I?ll catch up on the rest of notifications over the course of the next couple of days.

matt.fellows
2018-07-20 07:03
But one thing I will say from talking to clients today - that is a challenge. How do we orchestrate the sequence of adding new features in the contract without breaking the builds in a seamless way

liran.tal
2018-07-21 00:14
we?ve raised the same concerns internally too, although not to the point of refusing to use it. instead we thought we can come up with a process that solves it.

mboudreau
2018-07-21 02:07
I think it's mostly a UX issue. I believe we need to adhere to a more "github style" approach: create a branch for a new contract for both consumer and provider, once they both work, both are merged into "master" and deployed

mboudreau
2018-07-21 02:07
unless I'm not understanding the problem

bethskurrie
2018-07-21 03:19
That the way I always recommend.

liran.tal
2018-07-21 07:48
@mboudreau thing is that with that suggestion you are coupling the github branching methodology with how pact works

mboudreau
2018-07-21 07:57
And that's a bad thing?

liran.tal
2018-07-21 08:13
in my opinion yes.

liran.tal
2018-07-21 08:15
real world scenario in our webapps group (~30 devs) - there are a couple of teams working on a legacy system which is basically a monolith on the frontend and on the backend and they can?t move fast for different reasons like code quality, tests coverage etc. so they release once a sprint. on the other hand, there are also a couple of other teams which built their microservices systems as greenfield projects and can enjoy from trunk based development and CI/CD. So completely different git workflows employed by teams working on the same platform that eventually integrate with one another.

matt.fellows
2018-07-21 08:22
I'm with Liran on this. After all we're a set of tools, which need to be able to work in different contexts

matt.fellows
2018-07-21 08:23
Some contexts just won't be suited to CDC at all, but contract tests against legacy systems I see as a huge opportunity to solve

matt.fellows
2018-07-21 08:23
Every customer seems to be migrating away from their previous arch/approach and struggle to meet in the middle

mboudreau
2018-07-21 13:07
Interesting. I still don't exactly see how branching/versioning via contract would break that approach, let it be greenfield or monolith

matt.fellows
2018-07-21 13:40
If we're allowing people to define their own workflows, then yes. I think we're just saying we shouldn't be too prescriptive

abubics
2018-07-23 08:11
hello :wave: support issues here :slightly_smiling_face: - the pact icon links (when viewing the front page with tags) all take me to latest on our hosted broker, - also seems to be running pretty slow (but that might just be the internet in this building)

fergusstrange764
2018-07-23 13:51
has joined #pact-broker

fergusstrange764
2018-07-23 13:56
Seeing a fair few 503/4s from broker right now

fergusstrange764
2018-07-23 13:56
Anyone else experiencing issues?

matt.fellows
2018-07-23 20:46
Nothing from our monitoring folks

matt.fellows
2018-07-23 20:55
Everything looked pretty normal that time for us across the system, will take a look at your individual cluster this morning @fergusstrange764

slack1
2018-07-23 20:56
i saw a failed publish from a provider ci job around that time as well. seemed to clear up after a few minutes though

matt.fellows
2018-07-23 21:25
Thanks, will dig into that a bit more.

bethskurrie
2018-07-23 22:47
@abubics the first one is a genuine bug. Can you raise it in the pact_broker OSS repo please?

abubics
2018-07-23 23:07
Will do :)

arne.zelasko
2018-07-24 07:06
has joined #pact-broker

sguisado
2018-07-25 10:56
has joined #pact-broker

vinod.baradwaj
2018-07-25 12:38
has joined #pact-broker

richard.jones
2018-07-25 22:44
Hi folks, I might be missing something but I can?t seem to find a JSON to poke at in the broker to retrieve the latest verification results for a provider (I can do so for a consumer which is super awesome!). I can get a list of pacts from /pacts/provider/[name] pb:pacts but then the individual pact fetch doesn?t include the verification result (it?d be super nice if that first JSON listing the name had the verification result in the pb:pacts entries :smile: )

richard.jones
2018-07-25 22:47
I *could* fetch all consumer results for each consumer and match the name back to the provider but that?d be potentially much more expensive :slightly_smiling_face:

bethskurrie
2018-07-25 22:47
Hey @richard.jones I just haven't added it yet because I didn't have a use case driving it. You can get to it through the UI though.

bethskurrie
2018-07-25 22:47
I can easily add it to the API.

bethskurrie
2018-07-25 22:47
Can you tell me what you're trying to achieve?

richard.jones
2018-07-25 22:47
I?d prefer not to scrape the HTML :slightly_smiling_face:

bethskurrie
2018-07-25 22:47
HA. No.

bethskurrie
2018-07-25 22:48
If you use the can-i-deploy tool and turn it to JSON, you'll find the link to the relevant verification result.

bethskurrie
2018-07-25 22:48
`--format json` I think. Or `--output json`

richard.jones
2018-07-25 22:49
I?ve got a monitoring dashboard (grafana) that displays a bunch of information about our systems, including pact verification results. Now that we have verification results in the broker I can stop asking Bamboo whether a pact verification job failed, and instead ask the broker :slightly_smiling_face:

richard.jones
2018-07-25 22:49
Hmm, I?ve not used can-i-deploy - I?ll look into it, thanks

bethskurrie
2018-07-25 22:49
There are also the build badges

bethskurrie
2018-07-25 22:49
That would be an easy way to display the information.

richard.jones
2018-07-25 22:50
This data goes into a database which we can then query by team and use in a number of ways


bethskurrie
2018-07-25 22:51
Let me know if that doesn't get you what you want.

richard.jones
2018-07-25 22:51
I don?t have ruby stuffs installed on the VM I?m running this on so I?ll have to figure that stuff out :slightly_smiling_face:

bethskurrie
2018-07-25 22:52
You don't need ruby

bethskurrie
2018-07-25 22:52
it's a standalone cli

richard.jones
2018-07-25 22:52
ooh, nice, thanks!


bethskurrie
2018-07-25 22:53
If you're using the broker without can-i-deploy, you're not really getting the full benefit of contracts. I highly recommend learning about it.


bethskurrie
2018-07-25 22:54
Step 7.

richard.jones
2018-07-25 22:54
We?re still working on fixing a lot of the fundamentals which we didn?t get right in our implementation a long while back, and practises are embedded now, so we there?s a lot of momentum to shift. There?s a lot of interest from folks here in the dashboard work I?m doing in terms of visibility of pact information.

richard.jones
2018-07-25 22:55
(for example, we?re not using tagging, we?ve still got two separate pact broker installs for ?dev? and ?master?)

bethskurrie
2018-07-25 22:55
:cry:

richard.jones
2018-07-25 22:55
yah

bethskurrie
2018-07-25 22:56
Did the course with Ron help?

richard.jones
2018-07-25 22:56
Definitely! It?s cleared a whole lot of confusion up here ? slowly :wink:

richard.jones
2018-07-25 22:56
Things are much better post-Ron :slightly_smiling_face:

bethskurrie
2018-07-25 22:57
Ha. I'll have to quote that to him.

bethskurrie
2018-07-25 22:57
I'm itching to come out and be allowed to sort out the workflow!

richard.jones
2018-07-25 22:58
We could probably use another visit (to have some weight of authority added to our plannig), but I think we?ve got a pretty good idea what we need to fix

bethskurrie
2018-07-25 22:59
It all takes time and $$!

richard.jones
2018-07-25 23:04
Poking at can-i-deploy it still seems to be the consumer-oriented results whereas I?m after the provider view (all consumers of a provider)

richard.jones
2018-07-25 23:11
I have a solution for now, can proceed.

bethskurrie
2018-07-26 00:50
Richard, you should be able to give either a consumer or provider name - it makes no difference.

richard.jones
2018-07-26 01:56
Yep, but it only gives me the consumer results (the service in question is both consumer and provider)

richard.jones
2018-07-26 01:56
ie. ```$ ~/Downloads/pact/bin/pact-broker can-i-deploy --pacticipant PriceServicePython --latest --broker-base-url ... Computer says no ¯\_(?)_/¯ CONSUMER | C.VERSION | PROVIDER | P.VERSION | SUCCESS? -------------------|---------------|-----------------------|---------------|--------- PriceServicePython | 2.3.0-1f6e135 | ProductService | 0.1 | true PriceServicePython | 2.3.0-1f6e135 | BranchService | 0.0.0 | true PriceServicePython | 2.3.0-1f6e135 | CustomerPythonService | ??? | ??? PriceServicePython | 2.3.0-1f6e135 | GSTService | ??? | ??? PriceServicePython | 2.3.0-1f6e135 | PriceLikesService | 2.1.0-cd077c7 | true PriceServicePython | 2.3.0-1f6e135 | StateService | ??? | ??? ```

richard.jones
2018-07-26 01:58
(you can get a small glimpse there into the progress we?re making cleaning up a whole lot of things to make this work well :slightly_smiling_face: - only one participant has meaningful versioning and only 1/2 of them even register verification results)

richard.jones
2018-07-26 01:58
well, two participants have versions

richard.jones
2018-07-26 01:59
(as for the varying naming of participants, file that under ?please, don?t ask? :smile: )

bethskurrie
2018-07-26 04:41
if it only gives you the consumer results @richard.jones there is a bug

richard.jones
2018-07-26 04:41
Ah, ok

bethskurrie
2018-07-26 04:42
If it is a provider and consumer, you should get both rows

bethskurrie
2018-07-26 04:42
I'm sure I have test cases for that, but I often find that real world data has corner cases that I haven't thought of.

bethskurrie
2018-07-26 04:43
Did you find the json switch for it?

bethskurrie
2018-07-26 04:43
Also, can you raise an issue in the pact_broker repository and I'll look at it as soon as I can.

bethskurrie
2018-07-26 12:47
@richard.jones is the version number that's used for the verifications exactly the same as the version number that's used when the pacts are published? ie. is its consumer version number the same as its provider number? If they're different, whichever one was published most recently will be considered the latest, and the other one won't be included in that query.

richard.jones
2018-07-26 22:03
@bethskurrie Indeed, the versions do not match

ssn899
2018-07-27 16:02
I am not sure if I will get an answer, but I hope to start a discussion. A couple days ago I (very incoherently) posted about permissions within the `dius/pact-broker` image. Upon close examination, I see that the image is `FROM phusion/passenger-ruby24:0.9.26`. Phusion puts stuff in /sbin/my_init as root, and there is no way to change that (https://github.com/phusion/baseimage-docker/issues/264). From my understanding, it is not a good idea to run root in docker images. See http://blog.dscpl.com.au/2015/12/don-run-as-root-inside-of-docker.html and https://github.com/docker/docker-bench-security. My company mandates that docker containers run without write or execute permission. Is there any other way to get a docker version of the broker such that it runs without need of root (or one that builds `FROM` a different image)? I know that Matt said that it is possible to create my own image, but how can I do that while satisfying the permission restrictions? (I am also pretty new to docker)

matt.fellows
2018-07-27 19:18
It's a ruby app, you don't need phusion passenger to run it at all. It can be run in a pure Ruby image with `rackup` to start it

matt.fellows
2018-07-27 19:19
If you can run it locally first without docker your hand way there

ssn899
2018-07-27 19:21
But to deploy on our infrastructure, it needs to be a docker image.

matt.fellows
2018-07-27 19:21
So run it in a Ruby docker image, not a phusion passenger one

ssn899
2018-07-27 19:38
Wait, so I could just replace `FROM phusion/passenger-ruby24:0.9.26` with `FROM ruby`?

matt.fellows
2018-07-27 19:39
Pretty much. And then you start the Ruby process like you would on your desktop. Nothing special about it!

matt.fellows
2018-07-27 19:39
No tricks :laughing:

matt.fellows
2018-07-27 19:39
So you'll need to change `CMD`

ssn899
2018-07-27 19:41
What would I need to change `CMD` to?

ssn899
2018-07-27 19:42
Does it have to be anything specific?

matt.fellows
2018-07-27 19:49
Well atm phusion manages the process its own way. If you just look at the broker code base itself you just need to replicate the steps to running on your desktop in Ruby. So example https://github.com/pact-foundation/pact_broker/blob/master/example/README.md

matt.fellows
2018-07-27 19:50
Something like `bundle exec rackup -p 1234`

ssn899
2018-07-27 20:43
I get the following error when I run `bundle exec rackup`: ``` bundler: failed to load command: rackup (/home/app/pact_broker/vendor/bundle/ruby/2.5.0/bin/rackup) ```

ssn899
2018-07-27 21:35
So when I run with docker-compose, I get the following logs: ``` broker_app_1 | [2018-07-27 21:33:26] INFO WEBrick 1.4.2 broker_app_1 | [2018-07-27 21:33:26] INFO ruby 2.5.1 (2018-03-29) [x86_64-linux] broker_app_1 | [2018-07-27 21:33:26] INFO WEBrick::HTTPServer#start: pid=7 port=9292 ``` when I navigate to `localhost:9292`, I get localhost refused to connect.

uglyog
2018-07-27 22:27
@ssn899 make sure port 9292 is exported. Passenger runs on port 80, so the passenger based image will expose port 80

ssn899
2018-07-27 22:34
Thanks! When I navigate to localhost, I get `localhost didn?t send any data.`

bethskurrie
2018-07-29 21:36
@ssn899 you'll need to pass in `-p 80` when you start the process (if your permissions allow that) because you will have problems if you try to bind 80 on the host to 9292 in the Ruby process (the issues comes because the URLs don't get rewritten correctly, and Rack rejects requests that are not sent to the port that it's bound on.)

bethskurrie
2018-07-29 21:37
You'll hit problems if you try to run the current ruby app without any sort of web server in front of it. For starters, the default ruby app server (webrick) is single threaded, so at the very least, you'll need to add the `puma` gem.

bethskurrie
2018-07-29 21:40
Actually, having read that thread about the sudo permissions, you're not going to be able to run it on port 80 (or 443 if you're using ssl), so you'll need to pick a higher port to run and bind it to.

matt.fellows
2018-07-29 21:48
That's one approach, you could also scale the number of containers you run and have them all single threaded anyway. Also running as a root user in container is not necessary a security issue, it depends on how the underlying docker daemon is setup and maps users to the host

bethskurrie
2018-07-29 23:08
I agree. But that decision is out of our hands!

abubics
2018-07-30 06:33
fwiw, this is fixed as I check it this minute :slightly_smiling_face: I never got around to raising the issue, though :thinking_face:

bethskurrie
2018-07-30 06:37
Yeah, I fixed it.

bethskurrie
2018-07-30 06:38
I was going to @ you in the commit, but I couldn't remember your github username.

antonello
2018-07-30 14:27
has joined #pact-broker

antonello
2018-07-31 07:33
Where can I see an example of what `${pactbroker.githubVerificationStatus}` looks like?

bethskurrie
2018-07-31 07:36
Google "github commit api"

antonello
2018-07-31 07:37
I meant, does it contain any verification metadata?

bethskurrie
2018-07-31 07:38
No it's the string

bethskurrie
2018-07-31 07:39
Have a look at the webhook template library in the pact broker wiki

bethskurrie
2018-07-31 07:41
error, failure, pending, or success


antonello
2018-07-31 07:42
Ok, gotcha. Through `${pactbroker.verificationResultUrl}` you can then get to the details of the verification result.

bethskurrie
2018-07-31 07:42
I think we only use success, failure and pending

bethskurrie
2018-07-31 07:42
Yes.

antonello
2018-07-31 08:44
In the presence of a webhook for `contract_content_changed`, if a consumer publishes multiple pacts, and more than one pact changes, would the webhook be invoked multiple times?

bethskurrie
2018-07-31 09:36
If you created a webhook with a specific consumer and provider, then it would only be invoked once if that pact had changed. If you created a webhook for a particular provider (recommended) then that webhook would only be invoked once if that pact had changed, as each pact belongs to a different provider. If you created a webhook for a particular consumer, then the webhook would fire once for each pact that had changed.

antonello
2018-07-31 10:16
Thanks again :slightly_smiling_face: Can you create multiple webhooks for the same provider? For example if you want to trigger verification on two different branches for the provider.

bethskurrie
2018-07-31 10:17
Yes

antonello
2018-07-31 10:17
Fantastic! Thank you!

bethskurrie
2018-07-31 10:17
np

shashidesai
2018-07-31 20:21
has joined #pact-broker

antonello
2018-08-01 07:54
I?m trying to set up the pact-broker for local development

antonello
2018-08-01 07:54
but I?m encountering issues when running `bundle install`

antonello
2018-08-01 07:54
I?m on Mac

antonello
2018-08-01 07:55
What version of `mysql` should I have installed?

bethskurrie
2018-08-01 08:11
Postgres :-P

bethskurrie
2018-08-01 08:12
Just comment out the gem.

bethskurrie
2018-08-01 08:12
You won't need it.

bethskurrie
2018-08-01 08:13
When you say, local development, do you mean you want to run it, or work on it?

bethskurrie
2018-08-01 08:13
If you just want to run it, follow the instructions on the readme for setting up the example. You shouldn't need mysql.


antonello
2018-08-01 08:15
I am no ruby developer, but I wanted to look into how easy it would be to contribute

bethskurrie
2018-08-01 08:15
In that case, comment out mysql

bethskurrie
2018-08-01 08:16
You only need it on Travis.

bethskurrie
2018-08-01 08:17
The entire test suite runs against mysql, postgres and sqlite, but when you run it locally, they'll just use mysql by default.

antonello
2018-08-01 08:20
Is there anything else I have to do before I can run `bundle exec pact_broker:dev:setup` besides - `gem install bundler` - clone - `bundle install` ?

bethskurrie
2018-08-01 08:20
I don't think so, but I've probably not run it for ages.

bethskurrie
2018-08-01 08:20
What problem are you facing ml

bethskurrie
2018-08-01 08:20
?

antonello
2018-08-01 08:20
``` bundler: command not found: pact_broker:dev:setup Install missing gem executables with `bundle install` ```

bethskurrie
2018-08-01 08:21
Ha. You probably need rake.

bethskurrie
2018-08-01 08:21
It was a silly idea of mine to make a rake task to install things.

bethskurrie
2018-08-01 08:21
I should have made a shell script.

bethskurrie
2018-08-01 08:22
Just look at what it does and run it manually

bethskurrie
2018-08-01 08:22
It's just copying the example dir from memory

antonello
2018-08-01 08:25
`rake pact_broker:dev:setup` worked fine

antonello
2018-08-01 08:26
And I have a pact broker running locally

bethskurrie
2018-08-01 08:26
Oh! Yes. I didn't realise the command was missing the "rake'.

bethskurrie
2018-08-01 08:26
First PR?

antonello
2018-08-01 08:27
Maybe! I will see if I can get my head around it.

antonello
2018-08-01 08:27
:slightly_smiling_face:

bethskurrie
2018-08-01 08:28
If I get a moment, I'll try to add a bit more description to the developer docs.

matt.fellows
2018-08-01 09:21
mysql or postgres?

bethskurrie
2018-08-01 09:21
Gah! I meant sqlite.

matt.fellows
2018-08-01 09:21
:slightly_smiling_face:

bethskurrie
2018-08-01 09:55
@antonello I pushed a bit more documentation that might help you find your way around

antonello
2018-08-01 10:11
thanks @bethskurrie!

antonello
2018-08-03 16:21
@bethskurrie and everyone else here, I have a question, which may also be partly related to new WIP feature. It?s a bit long and perhaps a convoluted, but stick with me. Let?s say that - aside from feature branches - *Provider* has 3 branches at any single time: `master`, `release_candidate` and `production`. *Consumer* follows the same branching structure, so at any given time - apart from feature branches - it will have `master`, `release_candidate` and `production`. You have 3 webhooks for Provider, one for each of the 3 provider branches. All 3 provider branches, when built, verify pacts tagged with consumer tags `master`, `release_candidate` and `production`. This is because you want to know if a change made to Consumer and pushed to either `master`, `release_candidate` or `production` is compatible with all 3 provider branches. If you DID NOT do the above, the following could happen: - a field is added to Provider?s API response - the change is pushed into the `master` branch of Provider - Consumer starts consuming the new field and modifies the pact interaction - the change above is pushed to the `master` branch of Consumer - the webhook is fired and this will build Provider?s `master` branch - the verification succeeds (the pact won?t be a WIP pact anymore) - the Consumer team promotes the change to Consumer?s `release_candidate` branch - no webhook is fired because the pact has not changed - the Consumer releases the release candidate - Consumer is broken in production because in production the new field is not present in Provider?s response Conversely, by having the 3 webhooks I mentioned above, you will know whether the Consumer change you are promoting is compatible not only with Provider?s `master` but also with its release candidate and production versions. However you would end up with Provider?s `release_candidate` and `production` pipelines being red. On the one hand, I think that this may be a desirable side effect, because you want something that would stop you from promoting Consumer when it is incompatible with the Provider version that is in production or that may be about to go to production. On the other hand, how do you deal with Provider being red if you want to release it? Would the Provider team (which obviously may be the same team) say: ?Consumer, before you can push that change to master, we need to have released our change first. So revert you change please and let?s make a plan together?. Any thoughts on this? Is there something I am getting terribly wrong or that I?m missing?

cparrish
2018-08-03 18:42
has joined #pact-broker

bethskurrie
2018-08-05 21:53
can-i-deploy will stop the consumer deploying or promoting when it shouldn't.

bethskurrie
2018-08-05 21:55
The consumer won't be able to deploy the release candidate because there is no corresponding verification by the provider with the release candidate tag.

bethskurrie
2018-08-05 21:58
Yes, this workflow forces the provider to deploy to production before the consumer can be released to production, but you shouldn't need to have red builds on the provider. Let me get my head around it.

bethskurrie
2018-08-05 22:04
I think the key is "the consumer promotes the pact to the release candidate branch". At this stage, the broker will compare the pact content to the previous latest pact content (regardless of tags). Perhaps I need to make it tag aware. Let me ponder.

bethskurrie
2018-08-05 22:08
One of the features that I don't think you've included in the above plan is the "build protection" (which I haven't yet implemented). It's the ability to say, "consumer can't tag a version with a tag that could break our build until it's already been verified as a wip pact by the corresponding branch". Eg. If master branch of the provider verifies the master branch of the consumer, then a particular pact content must have been verified as a wip pact by the master provider before it can be published or tagged as a master pact by the consumer.

bethskurrie
2018-08-05 22:09
It's a bit convoluted, sorry!

bethskurrie
2018-08-05 22:10
Basically the pact has to have gone through the wip verification before it can be allowed to go through the real verification.

antonello
2018-08-05 22:36
Thanks @bethskurrie. I think I get it. I?ll re-read it tomorrow morning. I?m half asleep now. :sweat_smile: I think I?ve overlooked can-I-deploy, so that?s some reading for tomorrow and I will have to get my head around how to use it in a way that encourages ?shifting left?.

bethskurrie
2018-08-05 23:13
can-i-deploy is an absolute requirement for a workflow as sophisticated as yours. The consumer has to check the verification results, otherwise there's no feedback loop to let them know when they've got an invalid contract.

antonello
2018-08-06 06:57
I was thinking that the feedback loop could be provided by the webhook for the publication of the verification results.

bethskurrie
2018-08-06 07:22
I'd rely on can I deploy more than the webhook results.

bethskurrie
2018-08-06 07:23
Callbacks can be missed, or requests fail, or interleave.

bethskurrie
2018-08-06 07:23
Fetching the latest results is the most reliable method.

bethskurrie
2018-08-06 07:24
It's the pattern of "allow things to subscribe to change notifications, and then let them fetch and decide what to do with the data" pattern. I can't remember the short name!

antonello
2018-08-06 08:40
Yes, it makes complete sense. So, another thing related to this conversation. In the example I?ve given, you?d have the `release_candidate` branch for Provider verify only Consumer contracts tagged as `release_candidate`, and the `production` branch for Provider verify only Consumer contracts tagged as `production`.

antonello
2018-08-06 08:42
Actually, no - I don?t think that would work.

antonello
2018-08-06 09:10
?the broker will compare the pact content to the previous latest pact content (regardless of tags)? -> this means that if a new pact published by Consumer `master` (and then verified by Provider `master` following a webhook), when Consumer is then promoted to `release_candidate`, the webhook won?t be fired, because the pact content won?t have changed from the previous one.

antonello
2018-08-06 09:15
Clearly can-i-deploy could stop you from deploying `release_candidate` Consumer, because there is no corresponding verification by the provider with the release candidate tag. But then you?d have to manually trigger a Provider `release_candidate` pipeline. And how do you get around the fact that not only do you want to verify pact changes against `master` and `release_candidate` but also against the `production` version of Provider?

bethskurrie
2018-08-06 09:33
I would have each branch of the provider verify each branch of the consumer.

bethskurrie
2018-08-06 09:34
And I think I'll have to modify the logic for webhook firing.

bethskurrie
2018-08-06 09:34
It will need to check the tags as well.

antonello
2018-08-06 09:42
?I would have each branch of the provider verify each branch of the consumer? -> This would do, but it comes with two problems, I think. 1) Your feedback loop suffers from a potentially painful delay. In order to know if your Consumer release candidate is compatible with the Provider release candidate, you have to wait until you?ve cut release candidate branches. 2) You won?t be able to verify the Consumer release candidate with the Provider production version.

bethskurrie
2018-08-06 09:43
Not unless you check out the prod provider codebase and run the verifications against it.

bethskurrie
2018-08-06 09:43
How long do your verification tests take?

bethskurrie
2018-08-06 09:44
Do you use swagger by any chance in this codebase?

antonello
2018-08-06 09:45
I can?t say yet as we currently only a few tests that have been written as PoCs. The client is unwilling to move forward unless it?s clear how it?ll all fit in in terms of CI.

antonello
2018-08-06 09:45
There is some swagger documentation for some of the services, but not all.

bethskurrie
2018-08-06 09:45
If your verification tests take more than a few minutes, something is not right.

antonello
2018-08-06 09:46
When you say ?checkout the prod provider?, do you mean as a manual step?

bethskurrie
2018-08-06 09:46
It could be an automated step.

bethskurrie
2018-08-06 09:46
Have you read the pact nirvana doc?

bethskurrie
2018-08-06 09:46
It's the last step in there.

bethskurrie
2018-08-06 09:47
I don't generally think it should be necessary if you deploy the provider often though.

antonello
2018-08-06 09:48
I hadn?t read it, will read it today.

bethskurrie
2018-08-06 09:48
I think it will answer some questions

bethskurrie
2018-08-06 09:48
You've already worked most of it out.

bethskurrie
2018-08-06 09:49
I don't understand what you mean by "cut release candidate branch"

bethskurrie
2018-08-06 09:50
If it's all seeming too hard, one alternative is to use the swagger workflow

bethskurrie
2018-08-06 09:50
It's not fully supported by the broker yet though.

bethskurrie
2018-08-06 09:52
Basically, provider publishes a swagger doc with each build, and when it deploys, it marks that version as the prod/release candidate etc. It needs to use dredd to make sure it matches its own spec.

antonello
2018-08-06 09:52
Currently everything gets released together, and pact is seen as one of the tools that is going to enable them to start breaking things up and move towards releasing services independently. The workflow is that feature branches are merged into master and when they want to release (usually twice a week), a release branch is created from master for all the services/applications.

bethskurrie
2018-08-06 09:52
The consumer uses the atlassian pact swagger validator to check its pact against the swagger doc.

antonello
2018-08-06 09:53
That branch is used for regression testing and it?s then released to production. Once the release is successful, it?s merged down to the production mirror branch and to master.

bethskurrie
2018-08-06 09:53
Something that makes that workflow a bit trickier is that your shas will change every time you merge, right?

antonello
2018-08-06 09:54
Yes.

bethskurrie
2018-08-06 09:54
So you can't reuse a verification result from the previous branch.

bethskurrie
2018-08-06 09:54
Tricky.

bethskurrie
2018-08-06 09:55
If you could get people to commit to swagger/dredd (or some other way to keep swagger in sync with your code) the swagger method might simplify your workflow.

sgarvey
2018-08-06 11:23
has joined #pact-broker

antonello
2018-08-06 14:18
?The steps to reaching Pact Nirvana? guide is really well written. It all makes sense and it is - after all - along the lines what was already in my head. I have some questions, though. ?To reach Pact Nirvana, the final step is to have a CI build that checks out the code for the production version of your provider, and have it verify the same pacts that the head version does?. This makes complete sense and it could be triggered by a webhook, but it obviously means that that CI build will go red if a verification fails. Also, when it says ?If you have followed the recommended strategy of tagging provider versions in the broker on deployment to production?, is it referring to using `pact-broker describe-version`?

bethskurrie
2018-08-07 00:46
Yes.

bethskurrie
2018-08-07 00:48
> it obviously means that that CI build will go red if a verification fails. I would imagine this would be a side build, outside of the master build pipeline. Wouldn't you want it to go red?

bethskurrie
2018-08-07 00:49
You have such a complex set up, I'm really quite wary of using the pact only flow. It's sounding really complicated. Did the swagger workflow I described make sense? Would it be an option for you?

antonello
2018-08-07 06:37
I haven?t done any reading on it yet. I only remember a talk from Atlassian that I watched on YouTube some time ago.

antonello
2018-08-07 06:38
I think we can find a way to make a pact only flow work, with some compromises.

antonello
2018-08-07 06:48
Million dollar question... when do you think the WIP feature will be released?

bethskurrie
2018-08-07 08:32
The code is actually done, I was just trying to work out what to call it.

bethskurrie
2018-08-07 08:33
I think I've decided to call it "pending" instead of "wip". I can have it out as soon as I get the time to do a release. I'll try and do that in the next few days.

antonello
2018-08-07 08:40
By the way, because for each service we have a branch that is always inline with prod, we can do without having to tag provider versions

antonello
2018-08-07 11:53
I think I can find a way to make it work, the only thing that?s missing really is having the `contract_content_changed` logic tag based.

tcanascimento
2018-08-07 14:28
has joined #pact-broker

bethskurrie
2018-08-07 21:33
What languages are you doing your verifications in @antonello?

bethskurrie
2018-08-07 21:33
I'll see if I can do the tag thing.

antonello
2018-08-07 21:56
@bethskurrie Verifications in Java. (Consumers are more varied)

antonello
2018-08-07 21:59
I?ve started looking into the tag thing and I have an initial implementation. I?m not sure if it?s right though. I?ve added some tests for the repository, but haven?t finished the service tests.

antonello
2018-08-07 22:01
I was in the process of pushing the changes to a fork but didn?t get a chance to finish.

antonello
2018-08-07 22:05
I can see if I manage to do that before going to bed (it?s 11 pm here) so that you could review the changes?

bethskurrie
2018-08-07 22:06
I'm doing parenting work today, so I may or may not get a chance. I'll be doing Pact work tomorrow (actual job) so I can review them tomorrow.

bethskurrie
2018-08-07 22:06
I think that means you can go to bed...

conallbennett
2018-08-07 22:12
has joined #pact-broker

conallbennett
2018-08-07 22:46
Hey all, question on the docker pact broker. I know i found the answer to this before in the docs but I can't for the life of me find it again. To persist the data in the postgres th it needs to have a mounted volume, which postgres tables or store should that mount be against?

bethskurrie
2018-08-07 22:53
I would look in the docs for the postgres docker image

matt.fellows
2018-08-07 23:01
It will be something configurable like `PG_DATA`

matt.fellows
2018-08-07 23:01
You'll need to explicitly set it probably

antonios.klimis
2018-08-08 09:46
has joined #pact-broker

antonello
2018-08-08 16:16
After some conversations with @bethskurrie, I?ve just created a PR: https://github.com/pact-foundation/pact_broker/pull/226 Hopefully Beth will get a chance to review it later tomorrow (or today, depending on timezones!), but if anyone would like to have a look and provide feedback, they?ll be more than welcome. Also, if anyone could help me understand whey my PR would fall below the Codeclimate diff-coverage threshold, I would appreciate it. I?ve heavily tested my changes, so I?m struggling to get what?s happening there.

richard.hulm
2018-08-09 09:13
has joined #pact-broker

richard.hulm
2018-08-09 09:13
Hi, I'm getting a 504 trying to access my pact broker - is this the right place to report issues?

uglyog
2018-08-09 09:15
what is the URL for your broker?

richard.hulm
2018-08-09 09:16
DM'd you

richard.hulm
2018-08-09 09:41
Sorted - thanks!

codypumper
2018-08-09 20:19
has joined #pact-broker

bethskurrie
2018-08-10 02:22
if you are using the OSS docker pact broker, and you have been having problems with slowness or large database size, please upgrade to the latest version, as I have made some significant optimizations to the "index with tags" queries, and removed the massive pre-cached matrix table. This should make your broker run faster and cheaper!

lindblad.n
2018-08-13 07:30
has joined #pact-broker

amitojduggal
2018-08-13 14:48
has joined #pact-broker

amitojduggal
2018-08-13 14:50
Hello Guys, i have a basic question about the pact broker. in case of a failure in pact verification, how can i know from the pact broker, what was the cause of the error. Example, expected statusCode 200 and got 201. I see that from the maven console, when mvn:pactVerify is run, but is there a way to track it from the pact broker?

bethskurrie
2018-08-13 22:01
@amitojduggal it depends which language you're using. JVM does not have this yet, but the shared library that js, python, net and go use have this capability if they are on the latest version of what we call the "standalone".

bethskurrie
2018-08-13 22:01
Which language are you using?

richard.jones
2018-08-13 22:49
@bethskurrie - a general question about the broker: which APIs could be considered reasonably settled for now - is something like /pacts/provider/ProviderName/latest very unlikely to change, or should I be wary of making that assumption?

bethskurrie
2018-08-13 22:49
Always use the HAL relations.

bethskurrie
2018-08-13 22:50
If there's something you can't get to, let me know.

bethskurrie
2018-08-13 22:50
Most of the API is stable, but I make no promises for the future!

bethskurrie
2018-08-13 22:51
I've been planning a v2 where I want to standardise the naming a bit better, but I have no timeline for that yet.

richard.jones
2018-08-13 22:51
HAL is ? a pain to work with, but I will do so. So I should use pb:latest-provider-pacts from the root HAL, gotcha!

bethskurrie
2018-08-13 22:51
Why are you finding it a pain?

matt.fellows
2018-08-13 22:51
it?s just? meh

bethskurrie
2018-08-13 22:51
Do you have a client library?

bethskurrie
2018-08-13 22:52
It would suck doing it manually, but there should be a HAL client for all languages.

richard.jones
2018-08-13 22:52
It?s very ?well, JSON is all nice, but it really needs more SOAP? :smile: But more seriously, I think it?s that the current HAL client library for Python isn?t very user-friendly, and involves a lot of guesswork to make things work.

bethskurrie
2018-08-13 22:53
I wrote my own for the pact ruby, because I don't like to add dependencies that might clash with the user's ones.

bethskurrie
2018-08-13 22:53
It was quite simple, and simplified my code greatly.

matt.fellows
2018-08-13 22:53
we did the same for Pact Node, sorta. Depending on what you do, you don?t really need a lib

richard.jones
2018-08-13 22:53
For example, this code from pactman to publish results: ``` params = dict(success=self.result.success, providerApplicationVersion=version) overrides = dict(action='POST', encoding='application/json', fields=[coreapi.Field(name='success'), coreapi.Field(name='providerApplicationVersion')]) coreapi_client.action(self.hal, ['publish-verification-results'], params=params, overrides=overrides, validate=False) ``` vs the requests version: ``` http://requests.post(self.hal['publish-verification-results'].url, json=params) ```

richard.jones
2018-08-13 22:54
and it took me ? far too long to figure out that arcane hal_client version :confused:

bethskurrie
2018-08-13 22:55
That does look verbose.

richard.jones
2018-08-13 22:56
anyhoo, thanks for the tip, will not hard code that URL

bethskurrie
2018-08-13 22:56
My code does not look like that!

richard.jones
2018-08-13 22:57
I?m looking around for a nicer client

bethskurrie
2018-08-13 22:58
I just did a bare minimum impl in 4 classes

bethskurrie
2018-08-13 22:58
Entity, link, http client, response

richard.jones
2018-08-13 22:58
I?d prefer not to have to write my own HAL implementation, plenty of Pact-related code to write :slightly_smiling_face:

bethskurrie
2018-08-13 22:59
Fair enough

richard.jones
2018-08-13 23:00
https://github.com/deontologician/restnavigator looks like a much nicer interface, I?ll experiment with it

bethskurrie
2018-08-13 23:24
`http://pact_entity.post(PUBLISH_RELATION, verification_result)` is the Ruby code.

bethskurrie
2018-08-13 23:24
For tagging `provider_entity._link(VERSION_TAG_RELATION).expand(version: provider_version, tag: tag).put`

richard.jones
2018-08-13 23:28
yep, this library looks similar

bethskurrie
2018-08-13 23:29
just having a look at the readme. looks much better than that first example.

richard.jones
2018-08-14 00:02
way, way simpler :smile:

richard.jones
2018-08-14 01:40
Right, that?s all fixed :smile:

amitojduggal
2018-08-14 04:32
@bethskurrie Thanks, i am using JVM.

amitojduggal
2018-08-14 05:10
So this capability has to be build on the pact-jvm side, i can work on it; give me some pointers. :slightly_smiling_face:

richard.hulm
2018-08-14 08:13
:wave: I seem to be having issues DNS resolving `http://pact.dius.au`

matt.fellows
2018-08-14 08:15
Did you mean `http://pact.dius.com.au`?

richard.hulm
2018-08-14 08:15
....Ha yes

richard.hulm
2018-08-14 08:15
Thanks. My mistake.

matt.fellows
2018-08-14 08:16
:ok_hand:

matt.fellows
2018-08-14 08:16
Freaked me out!

vinod.baradwaj
2018-08-14 10:48
can we download pact file from broker ? is there any API available for that ?

bethskurrie
2018-08-14 10:50
Yes of course.

bethskurrie
2018-08-14 10:50
Have you looked at the documentation?



vinod.baradwaj
2018-08-14 10:53
i am making use of pact stub server to bring up the mocked provider(https://github.com/uglyog/pact-stub-server), for this can i link the pact files that are in pact broker ?

vinod.baradwaj
2018-08-14 10:53
wiki for pact broker says like, this is the endpoint for retrieving the pacts, http://your-pact-broker/pacts/provider/PROVIDER/consumer/CONSUMER/latest

bethskurrie
2018-08-14 10:54
I think so.

bethskurrie
2018-08-14 10:54
Have you tried it?

vinod.baradwaj
2018-08-14 10:55
yeah, when i tried to pass that URL as the pact file location, stub server was not able to recognise it as a pact file

bethskurrie
2018-08-14 10:59
Are you using basic auth?

bethskurrie
2018-08-14 10:59
I'm pretty sure the URL feature is supported.


vinod.baradwaj
2018-08-14 11:01
it says -U is for url resource, can we pass on that broker endpoint here ?

bethskurrie
2018-08-14 11:01
If the -u doesn't work, then please create an executable code example demonstrating the problem and raise an issue in the repo

bethskurrie
2018-08-14 11:01
Yes.

vinod.baradwaj
2018-08-14 11:02
sure, thanks Beth :slightly_smiling_face:

bethskurrie
2018-08-14 11:02
If you're using basic auth, you'll need to include the credentials in URL form I would expect.

vinod.baradwaj
2018-08-14 11:02
no, broker is open, its not having any auth

antonello
2018-08-14 11:21
Does the broker do anything ?magic? if it receives a pact that is identical in content, for the same consumer version and with exactly the same tags as the previous one?

antonello
2018-08-14 11:22
In other words, should it show up as a new version?

bethskurrie
2018-08-14 11:22
Yes

bethskurrie
2018-08-14 11:22
It ignores it

bethskurrie
2018-08-14 11:22
Yes, it is magic. No, it is not a new version.

antonello
2018-08-14 11:22
I should?ve asked 2 hours ago.

antonello
2018-08-14 11:22
It makes sense

antonello
2018-08-14 11:23
Is the magic based on all those 3 criteria?


bethskurrie
2018-08-14 11:24
The tags are irrelevant

bethskurrie
2018-08-14 11:24
They belong to the version resource

bethskurrie
2018-08-14 11:24
It's just based on the content and the consumer version number

bethskurrie
2018-08-14 11:24
Ordering of interactions and keys is ignored.

antonello
2018-08-14 11:25
Thanks @bethskurrie

antonello
2018-08-14 11:26
Does the broker just return a 200 regardless?

antonello
2018-08-14 11:26
Actually, I could check the code myself

bethskurrie
2018-08-14 11:27
I think it returns a 201 if a new resource was created, and a 200 otherwise

bethskurrie
2018-08-14 11:27
Why?

antonello
2018-08-14 11:32
Just curious. I was using the maven plugin which used the jvm broker client and it spits out the status code after publishing. It just says published (obviously), I?ll check later if I was getting a 200 rather than a 201.

bethskurrie
2018-08-14 11:34
That versioning page in the docs is really good, I recommend reading it if you haven't.

bethskurrie
2018-08-14 11:34
Someone else wrote it better than I could have!

antonello
2018-08-14 11:53
I read it last week when I was making the change to the broker, but I?d forgotten!

amitojduggal
2018-08-15 14:51
Hello ! with pact broker new deployment i am getting Publishing 'A-B.json' ... FAILED! 302 Moved Temporarily - <html> <head><title>302 Found</title></head> <body bgcolor="white"> <center><h1>302 Found</h1></center> </body> </html>

amitojduggal
2018-08-15 14:51
any pointers around this?

matt.fellows
2018-08-15 21:04
Where is it redirecting you to? How are you publishing it?

vinod.baradwaj
2018-08-16 06:08
Hi @bethskurrie from the endpoints will i be able to get the details like whether that pact file has been verified or not ?

bethskurrie
2018-08-16 06:09
Use the can-i-deploy tool


vinod.baradwaj
2018-08-16 06:10
i saw that broker client/can-i-deploy tool, but there are some restrictions in our environment to use such tools. Thats the reason i am planning to get those details by querying the broker

bethskurrie
2018-08-16 06:11
Turn on verbose to see the queries it makes.

vinod.baradwaj
2018-08-16 06:11
sure, thank you :slightly_smiling_face:

antonello
2018-08-16 09:21
Hi! It would be nice to pick your brain on something. The current git flow that my client uses is like this: - development is done on feature branches of `master` - branches are merged into `master` after testing - a `release-1.x.x` branch is taken from `master` for regression testing/fixing - once a release is ready to go live, it gets merged into a branch called `maint` from which the production artifacts are built - if a hotfix (or unplanned release) is required, a `hotfix-1.x.x` branch is created from `maint` - once the hotifix goes live, the branch is merged into `maint` from which the production artifacts are built All these branches publish pacts with a matching tag (`a-feature-branch-name`, `master`, `release_candidate`, `hotfix`, `maint`). Once a release has gone live, the appropriate pacticipant(s) versions and tags are tagged as `prod`. We want to make sure (among other things) that the `master` and `release_candidate` branches of the providers verify the latest pacts (among other tags) published with a `release_candidate` branch. Now, the issue is that once a hotfix release has gone live, any pacts tagged as `release_candidate` may be ?out of date?, as a new release may have gone live. How could we address the problem?

amitojduggal
2018-08-16 12:02
Hey, thanks, we were able to figure it out, it was because of redirection of the apis to a single sign on page internally.

matt.fellows
2018-08-16 12:19
Ahh :+1:

bethskurrie
2018-08-16 21:44
Is this because the hot fix never went through the release candidate branch?

bethskurrie
2018-08-16 21:44
As long as you're verifying the production pacts as well, I don't think it's a problem.

bethskurrie
2018-08-16 21:45
If you have a specific release process for the hot fix release, you could tag the same version as release candidate when you deploy.

antonello
2018-08-17 05:28
There may be a main release candidate and a hotfix branch going on at the same time.

bethskurrie
2018-08-17 05:45
I'll go back to, what is the problem if you're verifying the prod version as well?

antonello
2018-08-17 05:52
Yes. Prod will be the definitive one. Once prod has gone live we wouldn?t want to verify Any previous versions tagged as release candidate or hotfix.

antonello
2018-08-17 05:54
I just had a though though. All consumer are versioned with a release number (1.123.0, 1.123.1 and so on) + a sha. We could only verify pacts tagged with release and hotfix if the release number is > than that?s in prod.

antonello
2018-08-17 05:55
I?m not sure if the provider verification we use (mvn plugin) would allow that or if it?s even sensible.

bethskurrie
2018-08-17 06:04
I'm going to go back to my theory that using the swagger workflow would be simpler for you.

bethskurrie
2018-08-17 06:04
This is just feeling crazy complicated.

antonello
2018-08-17 06:26
There is a desire to make it simpler in the future

bethskurrie
2018-08-17 06:28
I wonder if you could just skip all the checks except for the prod and main line of development.

bethskurrie
2018-08-17 06:28
Maybe checking for each environment isn't necessary

bethskurrie
2018-08-17 06:30
If you imagine that prod has interactions 1 and 2, the latest dev has 1,2, 3, 4, and 5, and the intermediate branches have somewhere in between, maybe you only need to check each end of that spectrum.

antonello
2018-08-17 07:36
That is exactly what I think we may end up doing

antonello
2018-08-17 07:37
There is a risk of a bit of a delay in feedback but can_i_deploy will tell us

kristine.jetzke
2018-08-20 18:46
has joined #pact-broker

kristine.jetzke
2018-08-20 18:47
Hi, I recently noticed that env variable `PACT_BROKER_BASE_EQUALITY_ONLY_ON_CONTENT_THAT_AFFECTS_VERIFICATION_RESULTS` exists for the docker image. The doc states that the default is true but I can only find this place where it is set in the code: https://github.com/pact-foundation/pact_broker/blob/fa827c4122e742e13d5432da3dc24c3bec2423f1/lib/pact_broker/configuration.rb#L76 Am I missing something?

mmonson
2018-08-20 21:11
Is there a way to set the broker to use pactSpecification version 3.0? My provider states aren't showing up and I think it's because the broker is expecting V2, but I'm using V3. I didn't see anything about it here https://github.com/pact-foundation/pact_broker/wiki/Configuration

matt.fellows
2018-08-20 21:11
It supports them for publishing etc, it just doesn't render them yet

mmonson
2018-08-20 21:14
Thanks, do you know when rendering is coming?

matt.fellows
2018-08-20 21:32
Nope. It's not hard, just needs some time

komalahluwalia06
2018-08-23 07:23
has joined #pact-broker

ayodaiken
2018-08-24 19:11
has joined #pact-broker

rsaccoll
2018-08-27 13:27
has joined #pact-broker

slack1
2018-09-04 21:15
ive been running a personal broker on a free heroku instance and just got a notification that i'm close to the row limit for the free tier. ? do i remember there being something that was improved about the efficiency of how data was persisted? was there a command suggested to reduce the size of old data related to that? ? is there a recommended way to remove old versions that arent providing as much value anymore, or is that discouraged?

bethskurrie
2018-09-06 06:12
@slack1 grab the latest version - the data storage will be much less as I'm not storing the cached "matrix" in it's entirety any more. It will remove the data in the "materialized matrix" table in the migrations.

bethskurrie
2018-09-06 06:13
You can totally remove old versions that aren't used any more - I wrote a script to do it, but it was hard to do it in a general way, because the pacts that can be safely removed depend on how you're using it.

bethskurrie
2018-09-06 06:14
Eg. if you don't use tags, you can basically remove any pacts that aren't the latest ones. If you do use tags, you can remove any pacts that aren't your "prod" ones, or one of your "dev" ones that may be promoted to prod soon etc..

bethskurrie
2018-09-06 06:16
How's your ruby @mmonson? :wink:


slack1
2018-09-06 14:12
thank you very much for the info

culbluswan123
2018-09-06 15:06
has joined #pact-broker

culbluswan123
2018-09-06 15:11
I know that postgres is the recommended database for pact-broker. My question is that how strong recommendation is it? We have some limitations in introducing postgres at the moment as we already have mysql and mongo databases. We want to avoid adding a third database to the mix.

culbluswan123
2018-09-06 15:40
we're not so concerned about the support for json search at this moment. The major concern is around the support for mysql, I see some issues in the past around mysql migrations failing from time to time.

matt.fellows
2018-09-06 21:36
Each build is tested against MySQL so in theory it should work.

matt.fellows
2018-09-06 21:37
We run production broker systems on postgres so can speak to its stability, that's not to say you should have any issues with MySQL

bethskurrie
2018-09-07 04:20
MySQL is fully supported now, if grudgingly :wink: @culbluswan123

bethskurrie
2018-09-07 04:21
I believe that since we first made the decision (5 years ago?), MySQL now supports JSON searching. I should probably remove that comment.

culbluswan123
2018-09-07 04:22
Yes, MySQL 5.7 onwards there's support for JSON data type.

culbluswan123
2018-09-07 04:22
Thanks @matt.fellows and @bethskurrie

culbluswan123
2018-09-07 04:24
It would be helpful if the wiki and README are also updated to reflect the same. At least the fact that MySQL is fully supported

matt.fellows
2018-09-07 05:30
Beth just pushed a few changes to that repo - so should be up to date now :slightly_smiling_face:

bethskurrie
2018-09-09 21:39
Hey @antonello did you manage to work out a flow that you were happy with?

antonello
2018-09-10 06:17
Hey @bethskurrie! Not yet. I?m trying to get the team to engage so that we can make some trade offs together, but they haven?t engaged much.

mattgilbert90
2018-09-10 12:52
has joined #pact-broker

gaurav
2018-09-13 10:57
I see `Note: this contract could not be parsed to a v1 or v2 Pact, showing raw content instead.` with latest pact broker docker. Any suggestions? Thanks.

bethskurrie
2018-09-13 11:00
You can't do anything, unless you want to submit a PR. I just haven't gotten around to writing the code to display v3 pacts.

gaurav
2018-09-13 11:05
Not a ruby person yet. I could help with Java, react, python etc.. never used ruby. Will have to wait then :-)

gaurav
2018-09-13 11:44
Is it possible to change tag in pactbroker? *Scenario*: *1)* I run consumer tests in CI (mvn test), *2)* publish pact tagged as head: `mvn pact:publish -Dpactbroker.tags=head`.. *3)* deploy in QA environment, test software *4)* deploy in production *5)* Change latest `head` tag from `head` to `prod`. In step 5: Instead of running consumer tests again to generate pacts and then publish, I would like change latest `head` tag from `head` to `prod`. Can I achieve that? Thanks.

bethskurrie
2018-09-13 11:48
You can tag as many times as you like. Something can be latest head and latest prod.

bethskurrie
2018-09-13 11:48
Use the pact broker CLI

bethskurrie
2018-09-13 11:48
The recommend approach is to tag with the branch name and the stage name.

bethskurrie
2018-09-13 11:49
So a pact may be latest master, test and prod all at the same time.

bethskurrie
2018-09-13 11:49
Tag with the branch name when you run CI, then with the stage name every time you deploy.

bethskurrie
2018-09-13 11:50
This allows you to use can-i-deploy to make sure you can safely deploy a compatible version to a given environment.

gaurav
2018-09-13 11:51
thanks. sure. Then I can add a tag to an existing pact? Will have a look at pact broker cli.

bethskurrie
2018-09-13 11:51
Of course.

bethskurrie
2018-09-13 11:51
You actually tag a pacticipant version, not a pact.

bethskurrie
2018-09-13 11:52
But pacts can be identified by the tags on their version.

gaurav
2018-09-13 11:53
hmm okay thanks.. will check pact broker cli and do some thinking. :slightly_smiling_face:

bethskurrie
2018-09-13 11:58
Have a read of the "reaching pact nirvana" doc. There's a link to it in the pact broker wiki.

bethskurrie
2018-09-13 11:58
It explains how to get the most out of tagging.

gaurav
2018-09-13 12:18
Thanks quick q: suppose we tag a pacticipant version 1.0 as ?prod?, then we make some changes and then tag pacticipant version 2.0 as ?prod?. Now when we run provider test to validate against contracts tagged as prod (`mvn test -PproviderTests -Dpactbroker.tags=prod`), it will be run only against version 2.0 of pact, right? (although both 1.0 and 2.0 are tagged as prod)

bethskurrie
2018-09-17 02:20
Yes @gaurav it only validates the latest with the specified tag.

gaurav
2018-09-17 03:58
thanks. :slightly_smiling_face:

richard.jones
2018-09-18 23:08
Potentially weird question: say we have a new provider and we?d like to start up our automated monitoring system to check for failing pacts against it. There?s no consumers registered yet though, but AFAICT there?s no way to register a provider with the broker outside of registering a pact - so the latest-provider-pacts list will 404 rather than return an empty list. Just wondering what folks thoughts might be on this. Also relevant, I guess: the HAL libraries I have access to all handle the 404 case poorly, and barf because there?s HTML being returned instead of JSON.

bethskurrie
2018-09-18 23:54
1. You should get a JSON 404. I need to fix it if you're getting html

bethskurrie
2018-09-18 23:54
2. You can create a pacticipant with no pacts. Just post to /pacticipants with a JSON document with a name.

richard.jones
2018-09-19 05:45
1: ok, thanks! 2: ahah! I had forgotten that, thanks, that?ll solve the problem even betterer :smile:

bethskurrie
2018-09-20 02:11
Hey @richard.jones. We've fixed the content type for 404s, but just wondering if your tool cares whether you get an empty body, or if it expects a `{}`?

bethskurrie
2018-09-20 02:11
We've gone with empty body for now, but it can change.

richard.jones
2018-09-20 02:14
Hm, I honestly am not sure what the HAL libraries will do in either case. Thanks for fixing the content-type tho!

bethskurrie
2018-09-20 02:15
np. we're just pushing out the new docker image

richard.jones
2018-09-20 02:15
(sorry, my round tuits for testing such behaviour are in incredibly short supply at the moment)

bethskurrie
2018-09-20 02:15
np

bethskurrie
2018-09-20 02:15
it probably doesn't matter

slack1
2018-09-20 20:25
currently getting a 503 response when trying to push pacts to our hosted instance. any known problems right now?

slack1
2018-09-20 20:27
i can go to the instance in the browser and i do get prompted for credentials, but then get a page with just the text "Service Unavailable" (it also has the 503 status code)

slack1
2018-09-20 22:01
appears to be back

matt.fellows
2018-09-21 13:22
Hi folks, We've looked into a couple of point issues and resolved them today. if anyone else is experiencing issues don't hesitate to hit us up directly.

matt.fellows
2018-09-21 13:23
Apologies, looks like there were some intermittent issues which resolved itself, and we made some adjustments. Sorry about the interruption!

mmonson
2018-09-21 20:36
Anyone else having issues publishing to pact broker after upgrading gradle to 4.10.1? I get this response `HTTP/1.1 200 OK`, but the file on the broker hasn't changed.

uglyog
2018-09-23 22:29
Gradle version shouldn't make a difference, unless they have changed some core library. Debug logs will help (running with `-d`). Also check that the pact files have actually changed :wink:

richard.peckett
2018-09-27 09:28
Morning guys, can someone tell me if the pact broker docker image is compatible with windows?

bethskurrie
2018-09-27 09:34
I have some feeling that there has been trouble binding to port 80. But otherwise, it should be. I'm not a docker expert, but shouldn't all docker images be windows compatible?

richard.peckett
2018-09-27 09:56
Hi Beth, I wasn't sure as the readme for the docker image suggests having to set environment vars for connection strings and the like, obvs thats easy enough to do in windows but the readme seems geared toward linux so just wanted to ask the question :slightly_smiling_face:

bethskurrie
2018-09-27 09:57
Should be OK. As long as you can bind to port 80 on the host.

richard.peckett
2018-09-28 08:49
We managed to get this working and deployed in Azure Container instances yesterday, worked nicely with minimum effort! If anyone wants any help or instructions PM me!

bethskurrie
2018-09-28 09:10
Would you be interested in adding notes to the readme @richard.peckett?

richard.peckett
2018-09-28 09:12
sure thing, will do this tomorrow when I've got some free time

matt.fellows
2018-09-28 11:39
Good to know. I couldn?t understand why it wouldn?t work, but theory != practice

nnoble
2018-10-02 02:22
has joined #pact-broker

richard.peckett
2018-10-02 15:15
Still going to do this, sorry completely forgot over the weekend!

matt.fellows
2018-10-02 21:35
:grinning:

dervis4
2018-10-04 10:11
has joined #pact-broker

fraser.crichton.devel
2018-10-04 23:25
has joined #pact-broker

shekharsp27
2018-10-09 10:13
Hi, The Matrix on Pact Broker shows the high-level verification results, is there any way in Pact Broker where a user can see detailed verification result. For Example:- A detailed result which shows what was the contract and what is an execution result as well (e.g. which user gets while executing verification goal using maven).

bethskurrie
2018-10-09 10:20
Not in the JVM implementation. @uglyog is it reasonably straight forward to add an appender for the pact verification tests that would publish the results to the broker? In the ruby impl I just made another rspec formatter, it was quite easy. I'm not sure how the JVM outputs work though.

bethskurrie
2018-10-09 10:21
I could probably have a go at it myself now I'm back in the Java world, sigh.

shekharsp27
2018-10-09 10:33
:+1:

shekharsp27
2018-10-09 11:07
@bethskurrie Are there any API's which can be used to generate custom report for PACT tests

shawn
2018-10-09 15:29
has joined #pact-broker

inbox
2018-10-10 15:42
has joined #pact-broker

inbox
2018-10-10 15:45
Hi :wave: guys. Attempting to set up a pact broker via a local docker implementation using Postgres. When running test.sh step 11 fails after posting a heartbeat status url followed by `Waiting for the Pact Broker to be ready...parse error: Invalid numeric literal at line 1, column 10` I?d appreciate any help I can get on this

inbox
2018-10-10 15:53
according to the log in nginx it's having difficulty connecting to the postgres instance

inbox
2018-10-10 15:56
fixed :smile:

matt.fellows
2018-10-10 21:48
What was the issue? anything worth sharing?

liran.tal
2018-10-12 15:15
wow, great new issues :ok_hand:

matt.fellows
2018-10-14 21:54
@bethskurrie the Pending pacts feature, is that technically in the codebase now just not yet documented?

bethskurrie
2018-10-14 21:55
It needs an env var to be turned on in the verifier

bethskurrie
2018-10-14 21:55
I do need to document it.

alejandro.exequiel.ca
2018-10-17 19:49
has joined #pact-broker

antonios.klimis
2018-10-22 11:03
Any strategy on how to output the whole error stack on state setup stage? At the moment I get `Failure/Error: set_up_provider_state interaction.provider_state, options[:consumer]` which is not very helpful.

matt.fellows
2018-10-22 11:28
Hey @antonios.klimis - which language? Might be best asking there

matt.fellows
2018-10-22 11:28
it looks unrelated to the pact broker

antonios.klimis
2018-10-22 11:39
Ok @matt.fellows!

matt.fellows
2018-10-22 11:46
:thumbsup:

tarcio.saraiva
2018-10-23 23:38
has joined #pact-broker

shidhore.ajinkya
2018-10-26 11:33
has joined #pact-broker

sylvia.yap
2018-10-31 05:23
has joined #pact-broker

sylvia.yap
2018-10-31 05:27
Hi all, I have a question about the pact broker. I?ve published a pact for consumer C1 and provider P1 to the pact broker. And it is posted successfully with the correct version and listed on the matrix view as well as the pact list view. But when we trying to retrieve it, the pact was for a different consumer C2 to the same provider P1. Anyone has any idea what?s going on?

bethskurrie
2018-10-31 05:33
I've never heard of that happening. Can you look at the logs and identify which url it's publishing to, and which one it's being retrieved from?

sylvia.yap
2018-10-31 05:41
Yup, I?ve checked the log and confirmed that the url is the same

sylvia.yap
2018-10-31 05:43
Cause I can see the specific version that I?m publishing in the matrix and pact list view

bethskurrie
2018-10-31 05:47
Can you write a script to reproduce it on another broker?

sylvia.yap
2018-10-31 05:50
hmm.. let me try that

liran.tal
2018-10-31 06:13
can you share what are the two consumer names?

liran.tal
2018-10-31 06:13
I wonder if it?s some edge case with regards to lower/upper case letters or special chars being stripped off or something

matt.fellows
2018-10-31 07:32
@sylvia.yap how do you retrieve retrieve it?

sylvia.yap
2018-10-31 21:39
@liran.tal The consumers are SalespersonService and UserServicePython. The provider is EmployeeService

sylvia.yap
2018-10-31 21:41
@matt.fellows I?m retrieve the pact from the url {host}/pacts/provider/EmployeeService/consumer/SalespersonService/version/2.7.0-cd7b8710

bethskurrie
2018-10-31 21:58
@sylvia.yap I'm just getting you a test broker so you can try and replicate it against a database that I can then use to debug. Unless you can send me a copy of your database.

bethskurrie
2018-11-01 02:11
@sylvia.yap I'm going to PM you credentials to a test broker. Can you try and replicate it there, and I should be able to debug it.

bethskurrie
2018-11-01 02:12
I haven't been able to recreate it locally

liran.tal
2018-11-01 04:43
@sylvia.yap ok another idea. maybe the problem is actually on publishing the contracts to the broker and that?s why the get mixed. Is it possible you can test how you are publishing it? maybe you are using the wrong consumer name?

sylvia.yap
2018-11-01 04:44
@liran.tal Thanks for the suggestions and I think Beth found the issue, and it has been fixed now (#249 was raised for this bug)

liran.tal
2018-11-01 04:54
Ahh cool, happy to hear!

anothonyvong
2018-11-01 21:38
has joined #pact-broker

hansrd_98
2018-11-02 01:42
has joined #pact-broker

iryna.feuerst
2018-11-05 13:14
has joined #pact-broker

jbbarquero
2018-11-05 20:14
has joined #pact-broker

xcq1.defy
2018-11-06 09:28
has joined #pact-broker

nic
2018-11-06 13:09
has joined #pact-broker

hstene
2018-11-08 11:00
Is the pact-broker down? My team reports that their managed pact-broker is not responding?

hstene
2018-11-08 11:03
@bethskurrie ^

uglyog
2018-11-08 12:18
@hstene looks ok to me. What is the name of the broker instance your team use?

nihei.dev
2018-11-12 09:45
has joined #pact-broker

heymega
2018-11-13 10:32
has joined #pact-broker

kurst03
2018-11-18 00:41
has joined #pact-broker

kevin.meiresonne
2018-11-20 14:28
The hosted pact broker seems to be down... We're getting 503 responses.

mouser
2018-11-20 21:46
Yeah same here.

ravbaker
2018-11-20 22:07
has joined #pact-broker

bethskurrie
2018-11-20 22:19
@ugly is on it.

bethskurrie
2018-11-20 22:19
@uglyog!

uglyog
2018-11-20 22:20
Thanks @bethskurrie

bethskurrie
2018-11-20 22:20
We're planning to start moving customers to put our new environment tomorrow

pbanka
2018-11-20 22:24
has joined #pact-broker

jonas.natten
2018-11-21 06:42
has joined #pact-broker

sasa.milovic
2018-11-21 12:57
has joined #pact-broker

borsuk.artem034
2018-11-21 15:35
has joined #pact-broker

bernardo.guerreiro
2018-11-26 14:20
has joined #pact-broker

syed.haq
2018-11-26 14:20
has joined #pact-broker

inbox
2018-11-26 16:23
Hello, Our back broker was previously set up but not being utilized. It is now giving us a 404 `https://aramark.pact.dius.com.au/` did it get shut down?

bethskurrie
2018-11-28 21:49
@bethskurrie set the channel purpose: Discussion about the Pact Broker. For support regarding the DiUS hosted broker, email .

bethskurrie
2018-11-28 21:49
@bethskurrie cleared channel topic

ruben.perezg
2018-11-29 14:58
has joined #pact-broker

kamilmarkow
2018-11-29 16:57
has joined #pact-broker

dan
2018-11-30 16:06
has joined #pact-broker

thirumal.net
2018-11-30 19:26
has joined #pact-broker

antonello
2018-12-03 12:04
Hi @bethskurrie! Is it possible to customise the title or name of a webhook? Unless I?m missing something it does not seem to be possible.

sai.krishna
2018-12-03 14:33
has joined #pact-broker

sai.krishna
2018-12-03 14:55
Hi @bethskurrie trying to verify the published contract and its always getting timeout

sai.krishna
2018-12-03 14:56
``` Animal Profile Service listening on http://localhost:8081 Pact Verification [2018-12-03T14:54:07.105Z] INFO: pact-node@6.20.0/45416 on : Verifying Pacts. [2018-12-03T14:54:07.107Z] INFO: pact-node@6.20.0/45416 on : Verifying Pact Files [2018-12-03T14:54:10.336Z] INFO: pact-node@6.20.0/45416 on : Created './standalone/darwin-1.61.1/bin/pact-provider-verifier 'https://test.pact.dius.com.au/pacts/provider/Animal%20Profile%20Service/consumer/Matching%20Service/version/1.0.1543848742' --provider-base-url 'http://localhost:8081' --provider-states-setup-url 'http://localhost:8081/setup' --broker-username 'dXfltyFMgNOFZAxr8io9wJ37iUpY42M' --broker-password 'O5AIZWxelWbLvqMd8PkAVycBJh2Psyg1' --publish-verification-results 'true' --provider-app-version '1.0.0' --custom-provider-header 'Authorization: basic e5e5e5e5e5e5e5'' process with PID: 45417 1) should validate the expectations of Matching Service 0 passing (30s) 1 failing 1) Pact Verification should validate the expectations of Matching Service: Error: Timeout of 30000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/sai.krishna/Downloads/pact-js-master/examples/e2e/test/provider.spec.js) at Test.Runnable._timeoutError (/Users/sai.krishna/Downloads/pact-js-master/examples/e2e/node_modules/mocha/lib/runnable.js:440:10) at Timeout.<anonymous> (/Users/sai.krishna/Downloads/pact-js-master/examples/e2e/node_modules/mocha/lib/runnable.js:251:24) at ontimeout (timers.js:482:11) at tryOnTimeout (timers.js:317:5) at Timer.listOnTimeout (timers.js:277:5) ```

sai.krishna
2018-12-03 14:56
any help on this ?

andrew.nicholson
2018-12-03 16:29
has joined #pact-broker

andrew.nicholson
2018-12-03 16:34
Hi! Does the pact-broker support pacts using the version 3.0.0 spec? I have uploaded an async message pact to my broker, and I see this message when navigating to the pact in the UI: `Note: this contract could not be parsed to a v1 or v2 Pact, showing raw content instead.`

matt.fellows
2018-12-03 21:14
@andrew.nicholson yes it supports them, it just doesn?t render them yet. There is probably an issue in the broker for this, feel free to upvote (or better yet, a PR :slightly_smiling_face: )

matt.fellows
2018-12-03 21:14
All the usual operations work on them though (publish, retrieve, verify etc.)

matt.fellows
2018-12-03 21:15
You might need to provide some more help on this. Could be a transient network issue, could be a firewall etc.

matt.fellows
2018-12-03 21:15
can you navigate to the broker in the browser?

andrew.nicholson
2018-12-03 21:32
Noted, thank you!

matt.fellows
2018-12-03 21:34
:thumbsup:

bethskurrie
2018-12-03 22:46
We're doing a deployment of the hosted pact broker that will hopefully fix the 502s during deployment. Hopefully, you won't experience a 502!

kong
2018-12-03 22:57
has joined #pact-broker

madhukar.mishra
2018-12-04 09:13
has joined #pact-broker

madhukar.mishra
2018-12-04 09:22
Possible bug with how(when?) `provider-verification-published` event is handled in webhooks. Took reference from the template library https://github.com/pact-foundation/pact_broker/wiki/Webhook-template-library#github---publish-commit-status to create the webhook. ``` { "request": { "method": "POST", "url": "https://api.github.com/repos/ORG/${pactbroker.consumerName}/statuses/${pactbroker.consumerVersionNumber}", "headers": { "Content-Type": "application/json", "Authorization": "**********" }, "body": { "state": "${pactbroker.githubVerificationStatus}", "description": "Pact Verification Tests", "context": "${pactbroker.providerName} ${pactbroker.providerVersionTags}", "target_url": "${pactbroker.verificationResultUrl}" } }, "events": [ { "name": "contract_content_changed" }, { "name": "provider_verification_published" } ], "createdAt": "2018-12-04T06:17:26+00:00" } ``` But I guess that during creation `${pactbroker.providerVersionTags}` wasn't available, which is why two different statuses were created

jonas.natten
2018-12-04 09:43
Say i use tags for knowing which versions are deployed in which environment. So when i deploy my application i tag the deployed version `55555` with `prod`. This works fine and i can fetch the pact with `/pacts/provider/aaa/consumer/bbb/latest/prod`, but what if i deploy an old version say `44444` to prod now? The endpoint still returns the `55555` pact. Do i have to delete tags when i deploy a new version? How should i do that?

bethskurrie
2018-12-04 09:52
Yeah, that's tricky.

bethskurrie
2018-12-04 09:52
I'm afraid you would have to delete the tags from the later versions.

bethskurrie
2018-12-04 09:52
It's a bit of an unusual use case.

bethskurrie
2018-12-04 09:53
Can you explain it further?

madhukar.mishra
2018-12-04 10:14
We figured that putting tag in context doesn't help anyway, since it will keep making the status check different for each branch. Which means that we won't be able to make the status check required for the repo. Just the provider name as context works better.

jonas.natten
2018-12-04 11:00
We currently have a microservice architecture with a handful components. Before we deploy a component i want to check whether the component is compatible with the other components deployed to the environment.

jonas.natten
2018-12-04 11:08
So if one component has been deployed to `prod`, but then rollbacked to an older version. They both have the `prod` tag, but the latest endpoint returns the newest version.

richard.peckett
2018-12-04 11:35
morning peeps, does the broker support contracts for AMQP yet? (sorry if it's been asked a zillion times, I couldn't see anything about it in CHANGELOG.md on github)

jonas.natten
2018-12-04 11:37
So when i use `can-i-deploy` with `--to prod` it verifies against the wrong version (Which is no longer in the environment).

jonas.natten
2018-12-04 11:38
@bethskurrie ^

borsuk.artem034
2018-12-04 15:25
Hi, broker shows v3 specs just liker json file

yousafn
2018-12-04 20:13
has joined #pact-broker

yousafn
2018-12-04 22:06
Hey up all, I am working on a new greenfield application, integrating with some back end services. I am reasonably familiar with micro-service architecture and consumer driven contract testing. For around 5 years, I have advocated swagger use for documenting API's, especially in the initial start up phase, as it is always so hard to get people to agree to something concrete, especially in agile teams. I was recently introduced to PACT a few weeks ago, and instantly bought into the concept. I thought it would be a great asset to our team. I have built a POC which have received really great feedback. - It incorporates 4 providing API's and a single consumer. (although for demonstration, I incorporated a 2nd consumer, who hasn't followed the swagger design spec, to show PACT verification failures) - A pact broker is hosted on an ec2 instance with an rds postgres db - Consumers are publishing to the pact broker with a version number and git short commit sha `1.0.0-a43d33` and tagging with a branch name - Consumers are using `@pact-foundation/pact` written in typescript, executed with jest - Consumers are using `pactfoundation/pact-stub-server` docker with generated pact files, for component integration testing - Publishers are verifying against the hosted pacts. currently using `1.x.x` style versioning - Showed the use of can-i-deploy from the console with the pact ruby standalone app, but have mentioned that there are web hooks that can be used to trigger provider verification, when a consumer publishes a new pact. Things I am having trouble with in PACT (but haven?t investigated yet in the broker code) - Provider version numbers such as `1.0.0-a43d33` are rejected, I was only able to use <1.0.0> - branch names such as `feature/ABC-10` are not tagged Some questions that have been pitched by the client - Can we get reports that we can send round in an email? The console output from provider verification is well formatted, but only the JSON from the pact-broker looks to be visible. I need to look into report formatters. Devs were pleased to see that we could run the provider verification without publishing results to the broker (so they could get a decent report after a verification has failed) - it looks like a lot of hard work. - I am sitting on the consumer side, and we have already built it into our pipeline so we are publishing pacts to a broker. It looks to me that on the provider side, their touch points with PACT is light. They don?t need to own or provide their consumer a mock, to allow them to work in insolation. The verification is simply ensuring they have implemented their contract correctly and the clients expectations have been met. There is a point on provider states, but that isn?t PACT specific - we would always want our provider to provide test data & states to stimulate different test cases as in any other api testing framework. Things I need to investigate - provider versioning (want to include git short sha) - branch tagging (want feature/ABC-10 format branches to show up in the broker) - reporting of verifcation failures in a pretty format - provider states

yousafn
2018-12-04 22:12
PS. Thanks for the awesome work Dius crew :fist:

bethskurrie
2018-12-04 22:59
I don't have time to address all your issues right now, but I will get back to you. I've quick question, which version of the broker are you using? The date ordering should be turned on in the latest version, so the version number can be anything. Also, I've fixed the tags with slashes issue.

bethskurrie
2018-12-04 23:00
It sounds like you have an old version.

bethskurrie
2018-12-04 23:05
> - it looks like a lot of hard work

bethskurrie
2018-12-04 23:06
It's not insignificant, but compare it to the work you would do if you were trying to do everything via traditional integration tests. As the number of interactions increases, traditional integration tests scale exponentially, where as contract tests scale linearly.

bethskurrie
2018-12-04 23:07
As always, you as the developer need to make informed decisions based on the tradeoffs in your particular situation. Generally, at least some level of contract testing gets a better ROI than 1. nothing or 2. only doing traditional integration tests.

bethskurrie
2018-12-05 00:18
We're having some issues with the hosted environment at the moment, and will be pushing out a fix soon.

thirumal.net
2018-12-05 00:32
*How to Add Provider Side Tag to Pact Broker* ? i am able to run the provider verification successfully and publish the result to pact broker but not sure how to attach tag to pact broker from provider side ? using the pactNet:

bethskurrie
2018-12-05 03:13
I'm not sure if the .net impl has it yet. You can raise an issue in the pact-net repo, and in the meantime, use the pact broker client CLI


madhukar.mishra
2018-12-05 08:35
> "traditional integration tests scale exponentially, where as contract tests scale linearly" sounds like a cool concept that could strengthen my team's interest in contract testing. Would love it if you could elaborate a bit

jonas.natten
2018-12-05 11:48
@bethskurrie Could you explain to me what is unusual about my use case (or how I should do it differently) as we spoke about previously in the thread? (https://pact-foundation.slack.com/archives/C9VPNUJR2/p1543916586017400) I tried to elaborate in the thread, but i would think rollbacking is something that might be needed occasionally for everyone (?)

yousafn
2018-12-05 19:21
I have worked with a 20 microservice eco system, where we covered everything with traditional integration tests, but also ran CDC tests within the same framework, and used mocks generated with Wiremock. This has been simpler to implement as your framework is very well documented and reasonably mature. The pact-broker is a great tool to allowing a central repository for expectations, and the swagger mock validator, helping to tie the pacts (and therefore our development) up to our swagger specs will be invaluable. Our first pass of the swagger-mock-validator threw up 68 errors, where the swagger has evolved but these changes were not communicated to the consumer dev team. It will be interesting to see it play out. There are still decisions to be made on our provider side, latest news is that we are going to have an api gateway acting as a pass through to some internal services, so we may have to look at non-http based contract testing options available within PACT. @madhukar.mishra - Contract testing is an invaluable tool in API development. If your team is interested in some reading https://martinfowler.com/articles/consumerDrivenContracts.html or get some pizzas in for lunch and get them to watch this https://www.youtube.com/watch?v=-6x6XBDf9sQ

yousafn
2018-12-05 19:23
Thanks for getting back to me, there is no rush. I am currently using `x-pact-broker-version: 2.27.3` and have noted its a few versions behind so will get it updated!

thirumal.net
2018-12-05 21:08
@bethskurrie -Thank you, i will raise an issue

bethskurrie
2018-12-05 21:45
I guess I've mostly worked in "roll forward only" environments. If there's a bug, it gets fixed and a new version goes out.

bethskurrie
2018-12-05 21:46
These are environments where ci/cd is strong, and releases are quick and frequent.

bethskurrie
2018-12-05 21:46
So it's just simpler to go forward.

bethskurrie
2018-12-05 21:47
I understand that different places have different methods of working though.

bethskurrie
2018-12-06 08:55
@yousafn great, let me know if you're still having any of those problems

bethskurrie
2018-12-06 09:01
the broker supports all json documents.

bethskurrie
2018-12-06 09:01
whether or not it displays them nicely is another question!

bethskurrie
2018-12-06 09:02
:thumbsup::skin-tone-3:

bethskurrie
2018-12-06 09:05
@madhukar.mishra > "traditional integration tests scale exponentially, where as contract tests scale linearly" When you test from a "high" level, (eg traditional integration tests) you have to execute paths you have already tested before, just to get to get to the place where you can test the thing you're interested in. Eg. you have to execute login for every test, and if you have 100 tests, you have to execute login 100 times. With a contract test, you would test login once.

bethskurrie
2018-12-06 09:08
This is why it scales so much better. If there is a new endpoint, you implement and execute one (or maybe a few, if there are variations) new test. If you're using integration tests, you may have to make multiple API calls just to get to the place where you can test the new call. And then, perhaps, you want to test variations on it, so you're adding n*y new calls to the suite. It's easy to see why integration tests get out of hand so quickly.

jonas.natten
2018-12-07 06:13
I see, think i will try to write a script for deleting the tags then. Thanks for the replies! :slightly_smiling_face:

ravbaker
2018-12-07 11:31
I have an issue similar to described here: https://pact-foundation.slack.com/archives/C9VPNUJR2/p1543915335013800 with webhooks and `provider_verification_published` event.

ravbaker
2018-12-07 11:34
my webhook looks like this: ```{ "consumer": { "name": "NAME" }, "events": [ { "name": "provider_verification_published" } ], "request": { "method": "POST", "url": "https://api.github.com/repos/ORG/project/statuses/${pactbroker.consumerVersionNumber}", "headers": { "Content-Type": "application/json" }, "body": { "state": "${pactbroker.githubVerificationStatus}", "description": "Pact Verification '${pactbroker.providerVersionTags}' ${pactbroker.consumerVersionTags}", "context": "PACT-${pactbroker.providerName}-${pactbroker.providerVersionNumber}", "target_url": "${pactbroker.verificationResultUrl}" }, "username": "...", "password": "...." } }``` and issue I experience is that `${pactbroker.providerVersionTags}` doesn?t show anything. Although the `${pactbroker.providerName}` and `${pactbroker.providerVersionNumber}` are present. Any idea why? I use pact-broker `v2.27.5`

ravbaker
2018-12-07 11:39
It?s crucial to us because we run two verifications every time contract changes once on `develop` and other on `master` to know where is it now ready and whether or not was it released. And we store the branch name in the provider tags.

ravbaker
2018-12-07 12:40
even when I try to test the webhook run through `pb:execute` I do not get the `tags` :confused:

ravbaker
2018-12-07 14:47
I discover that for lookup via `tag` with `pact_uri` like: `https://pactbroker.project.com/pacts/provider/Elli/consumer/Demeter/latest/develop` in `_links` section for `"pb:publish-verification-results"` returns not the same version of contract that was in return but returns latest pushed contract variant. Any thoughs why it happend? Also same other version I see in `"pb:diff"` section. It bites me much on `rake pact:verify` run because then the verification is submit to a different version of contract and it ends with a mess. @bethskurrie

ravbaker
2018-12-07 15:02
looks like `pact_version_sha` is different from `consumer_version_number` on same `represented` pact record

ravbaker
2018-12-10 08:59
@bethskurrie can you help me somehow?

ashish.dubey91
2018-12-10 11:16
has joined #pact-broker

richard.hulm
2018-12-10 11:35
Hiya! We're getting 401s from the broker - implying our credentials have been rotated

richard.hulm
2018-12-10 11:35
What's the best place to keep track of this?

matt.fellows
2018-12-10 11:39
Hi Richard, can youoo please DM me with more detaials?

ashish.dubey91
2018-12-10 12:25
cross posting this from #general: for some reason from my ubuntu machine I can `dig http://foo.pact.dius.com.au` just fine but when I do `curl http://foo.pact.dius.com.au` I get `Could not resolve host: http://foo.pact.dius.com.au` any DNS changes happened recently?

matt.fellows
2018-12-10 12:41
is `foo` important to you or are you obscuring the real domain?

matt.fellows
2018-12-10 12:41
``` > dig http://foo.pact.dius.com.au +short *.http://pact-prod.dius.com.au. 13.211.26.183 13.236.214.174 ```

ashish.dubey91
2018-12-10 12:50
obscuring the real domain. foo -> grofers in my case

d.van.dijk
2018-12-10 13:58
has joined #pact-broker

d.van.dijk
2018-12-10 14:04
@matt.fellows http://portbase.pact.dius.com.au could not be resolved either.

d.van.dijk
2018-12-10 14:35
I'm experiencing the same problem as @ashish.dubey91 Coleagues on Windows can reach the site, but on Ubuntu I can't. Our Jenkins build server on linux experiences UnknownHostException. Anyone?

richard.hulm
2018-12-10 16:15
Hiya we're having the same DNS resolution issues

richard.hulm
2018-12-10 16:18
It seems http://foo.pact.dius.com.au is being redirected to *.http://pact-prod.dius.com.au which is breaking the DNS lookup

richard.hulm
2018-12-10 16:18
You can getaround it by using http://foo.pact-prod.dius.com.au (but the SSL cert is wrong)

bethskurrie
2018-12-10 19:15
Hi guys. We've done some DNS magic to migrate to the new infrastructure without downtime (or that was the plan!) This had had some unexpected effects. We'll address them asap.

bethskurrie
2018-12-10 19:17
Sorry about the inconvenience. The new environment will be much more stable than the old one once we've sorted out the teething issues.

bethskurrie
2018-12-10 20:09
Ok @d.van.dijk @richard.hulm @ashish.dubey91 can you try again now?

bethskurrie
2018-12-10 20:10
I'm guessing you're all probably asleep. The joys of working in a global distributed industry!

ashish.dubey91
2018-12-10 20:40
it works now! :slightly_smiling_face:

ashish.dubey91
2018-12-10 20:41
I'm curious to find out though how DNS resolution behavior was weird with the changes you guys did

ashish.dubey91
2018-12-10 20:43
Mac -> dig and curl are both able to resolve. On Ubuntu however, dig is able to find A records but not curl

matt.fellows
2018-12-10 21:15
It seemed only to be the case on Ubuntu but could more likely be related to specific versions of tooling/network stack

matt.fellows
2018-12-10 21:16
But yes, strange

bethskurrie
2018-12-10 21:17
My guess is that some implementations do some extra smarts when there are wildcards involved.

matt.fellows
2018-12-10 21:18
It should also be noted that it did work on other Linux variations (in our case Amazon Linux)

d.van.dijk
2018-12-11 06:55
Yes, it works

d.van.dijk
2018-12-11 06:55
thanks

matt.fellows
2018-12-11 07:16
:thumbsup:

richard.hulm
2018-12-11 09:54
All good - thanks for your help @bethskurrie and @matt.fellows (Quite right - we're in the office ~9-17 GMT! Woo worldwide economy :stuck_out_tongue: )

ravbaker
2018-12-11 13:48
@bethskurrie any chance getting some help on this?

tghcastro
2018-12-12 13:25
has joined #pact-broker

ravbaker
2018-12-13 07:23
Few days ago I posted an issue yet got no answer. But I believe it?s a real flaw in pactbroker. Any chance someone can help me? https://pact-foundation.slack.com/archives/C9VPNUJR2/p1544194044044700

matt.fellows
2018-12-13 07:28
If that?s true, I think the best starting point would be to create a bug on the pact-broker repository, with something we can use to reproduce the issue.

bethskurrie
2018-12-13 07:35
It would surprise me if nobody had noticed this, as it is critical functionality. I won't rule it out thought. Can you please create a script to recreate it @ravbaker? Note that the verifications belong to the content, not the consumer version, so if the latest has the same content as the latest develop, the verification result will apply to both.

brentbarker9
2018-12-13 23:05
I upgraded my local pact docker from 2.24.0 to 2.27.6 and I'm having issues with viewing some pacts

brentbarker9
2018-12-13 23:05
I get the following error:

brentbarker9
2018-12-13 23:05
`this contract could not be parsed to a v1 or v2 Pact, showing raw content instead.`

brentbarker9
2018-12-13 23:05
but other v3 contracts are rendering OK

brentbarker9
2018-12-13 23:05
does the pact broker not support v3 pacts in all cases?

brentbarker9
2018-12-13 23:05
the old version rendered it just fine

matt.fellows
2018-12-13 23:12
> does the pact broker not support v3 pacts in all cases? The broker doesn?t support _visualising_ v3 pacts at all. It supports them for all the usual operations, you just can?t render them

bethskurrie
2018-12-13 23:12
Render them nicely

matt.fellows
2018-12-13 23:12
are you sure other v3 pacts are rendering OK? (perhaps they are v3 part aren?t using any of the v3 features)

bethskurrie
2018-12-13 23:13
They render the JSON

zach.the.hammer
2018-12-18 16:11
has joined #pact-broker

zach.the.hammer
2018-12-18 16:13
Any plans to add some of the v3 features to the pact broker UI? Specifically for the markdown pact document. 1. multiple provider states 2. provider state variables

zach.the.hammer
2018-12-18 16:15
lol as always i should check if matt posted a response to my question right before i posted it


matt.fellows
2018-12-18 23:00
If you?re feeling generous, it shouldn?t be a big PR :slightly_smiling_face:

zach.the.hammer
2018-12-18 23:27
Ha maybe this weekend

zach.the.hammer
2018-12-18 23:41
Is the web ui code in the pact broker repo?

zach.the.hammer
2018-12-18 23:42
Can you point out where the pact rendering code is?

matt.fellows
2018-12-18 23:42
yep, at the moment

matt.fellows
2018-12-18 23:42
ummm? maybe


zach.the.hammer
2018-12-18 23:43
Haha i am there

matt.fellows
2018-12-18 23:43
actually, maybe not

zach.the.hammer
2018-12-18 23:43
I see the network view

zach.the.hammer
2018-12-18 23:43
But not the actual pact


matt.fellows
2018-12-18 23:45
It?s going to be a new Resource I think



matt.fellows
2018-12-18 23:46
The latter being the `text/html` ?renderer? for the new resource

zach.the.hammer
2018-12-18 23:47
Oh god

zach.the.hammer
2018-12-18 23:47
Ruby

zach.the.hammer
2018-12-18 23:47
Ha ok i will explore this when i have some time

matt.fellows
2018-12-18 23:47
indeed

matt.fellows
2018-12-18 23:48
I think it?s more wrapping your head around WebMachine which is basically HTTP projected unto overly precise OO concepts. It?s pretty great though, from what little I?ve seen of it

zach.the.hammer
2018-12-18 23:50
Pact::Doc::Markdown::ConsumerContractRenderer

zach.the.hammer
2018-12-18 23:51
Seems like that?s where the magic happens

zach.the.hammer
2018-12-18 23:51
Alright thanks matt. I?ll see what i can do

matt.fellows
2018-12-18 23:52
:thumbsup:

matt.fellows
2018-12-18 23:52
Know that any progress you make here will make lots of people happy (and probably avoid another repeat of that question tomorrow :laughing: )

zach.the.hammer
2018-12-19 00:02
haha whatever i can do to get beth to answer more of my random questions

dglaubman
2019-01-03 22:27
has joined #pact-broker

thomas.scheuchzer
2019-01-05 10:22
has joined #pact-broker

ilya.markevich1991
2019-01-05 21:06
has joined #pact-broker

lmoore
2019-01-07 04:21
has joined #pact-broker

serikch
2019-01-07 08:58
has joined #pact-broker

mehdizonjy
2019-01-10 07:55
has joined #pact-broker

mehdizonjy
2019-01-10 09:03
hello everyone Thanks for all the work you've put into the broker and the whole pact echosystem. I'm currently spiking on creating a POC and integrating Pacts Broker into our pipeline. I'm stuck on configuring the `contract_content_changed` webhook. I can execute the webhook manually and it's able to access and call my provider's CI. However whenever my consumer updates their version and publishes a new contract, the webhook shows `not run` status and it's not attempting to call my endpoint. There doesn't seem to be any log messages when i try to access the `logs endpoint`. anytips on how to further debug this ?

matt.fellows
2019-01-11 03:09
@mehdizonjy are you actually publishing a _new_ contract? as in, are there new fields / interactions in it? If it?s just a new version, this won?t trigger (as the contract itself hasn?t changed, and therefore there is no reason to bug the provider about it)

mehdizonjy
2019-01-11 03:12
thanks for the reply. i changed both the contract (by requiring an extra field) and pumping up the consumer version. it's worth noting that i'm using the hosted pacts broker solution , but when running pacts broker locally on my machine via docker it's working like a charm.

matt.fellows
2019-01-11 03:24
hmm thanks

matt.fellows
2019-01-11 03:24
@bethskurrie any ideas how to debug this?

bethskurrie
2019-01-11 03:26
There should be some debug logs that say what's going on with regards to webhooks when a pact is published

bethskurrie
2019-01-11 03:26
we'll need to bump the log level

bethskurrie
2019-01-11 03:28
If you're just messing around (ie. it's a test pact) then try deleting the pact entirely and starting again.


mehdizonjy
2019-01-11 03:51
i just removed all the published pacts, and then published a new version. however it's still stuck at `notRun`. I then proceeded to removing the both participants and give it another try, sadly no luck :cry: > we'll need to bump the log level is there away for me to do that in the hosted broker solution and access the logs ? the logs on the webhook itself are still empty

bethskurrie
2019-01-11 03:51
no, these are logs you can't see.

bethskurrie
2019-01-11 03:58
@mehdizonjy I'm just deploying a change to prod which will allow me to modify the log level dynamically and check out why it thinks it's not changed.

mehdizonjy
2019-01-11 03:59
awesome, thanks for taking the time to help me debug this ^_^

bethskurrie
2019-01-11 04:03
``` def update_pact params, existing_pact http://logger.info "Updating existing pact publication with params #{params.reject{ |k, v| k == :json_content}}" logger.debug "Content #{params[:json_content]}" updated_pact = pact_repository.update existing_pact.id, params if existing_pact.json_content != updated_pact.json_content webhook_service.trigger_webhooks updated_pact, nil, PactBroker::Webhooks::WebhookEvent::CONTRACT_CONTENT_CHANGED else logger.debug "Pact has not changed since previous revision, not triggering webhooks" end updated_pact end ```

bethskurrie
2019-01-11 04:03
ok, that's not helpful



mehdizonjy
2019-01-11 04:05
is that what's happening ?


bethskurrie
2019-01-11 04:05
That's the critical logic.

mehdizonjy
2019-01-11 04:06
so basically the broker is not detecting any changes in the pact ?

bethskurrie
2019-01-11 04:06
Yes.

mehdizonjy
2019-01-11 04:06
therefore it'snot running the webhook

mehdizonjy
2019-01-11 04:06
:neutral_face:

bethskurrie
2019-01-11 04:07
I'm not sure why.

mehdizonjy
2019-01-11 04:07
how come following the same steps on my local pact broker produces different results ?

bethskurrie
2019-01-11 04:08
I'm not sure.

bethskurrie
2019-01-11 04:08
Can you PM me your broker subdomain?

leslie.fung.lf
2019-01-11 09:04
has joined #pact-broker

gbivins4
2019-01-12 00:24
has joined #pact-broker

galvinshane
2019-01-18 11:35
has joined #pact-broker

galvinshane
2019-01-18 11:46
Im wondering is it possible to change the default port (from 80) and context path of pact broker? so i am using docker to deploy to kubernetes and would like to be able configure ingress with a path of /pact and also change the default port. Wondering if there are environmental variable to can set to achieve this currently?

gopinathlangote11
2019-01-18 15:58
I think you can do it

galvinshane
2019-01-18 16:58
Hi Gopinath, have you been able to do this? would you happen to remember how to did?

pravera
2019-01-23 13:59
has joined #pact-broker

hossam.saraya.ext
2019-02-01 09:26
has joined #pact-broker

hossam.saraya.ext
2019-02-01 09:26
anyone around?

bethskurrie
2019-02-01 09:27
yes

hossam.saraya.ext
2019-02-01 09:28
Hey @bethskurrie. How is your day going?

bethskurrie
2019-02-01 09:28
Pretty good. Working on the commercial broker today.

bethskurrie
2019-02-01 09:28
Should have some social logins coming out soon

bethskurrie
2019-02-01 09:29
Been a long time coming

hossam.saraya.ext
2019-02-01 09:29
Oh sounds good! I didn't see any paid plans. Only saw the free option

bethskurrie
2019-02-01 09:30
We've got to get something to pay for first!

hossam.saraya.ext
2019-02-01 09:30
:smile: like a big strong broker

matt.fellows
2019-02-01 09:31
Big strong broker - new contender for product name :laughing:

hossam.saraya.ext
2019-02-01 09:31
:smile:

hossam.saraya.ext
2019-02-01 09:32
Okay so at my company we have a distributed microservices arch. services live on a private network and outside world can't access services directly. We also don't have an API gateway layer, we have frontend servers that speaks with the services in the private networks

hossam.saraya.ext
2019-02-01 09:32
So, I am setting up pact between the smallest provider/consumer we have to get started

hossam.saraya.ext
2019-02-01 09:33
One question is, if I use the hosted pact broker. *Can I assume that the broker machine ip is static* so that I can whitelist it

hossam.saraya.ext
2019-02-01 09:34
Otherwise, I will not be able to setup webhooks because the http requests fired from the broker will never reach our network

bethskurrie
2019-02-01 09:34
Understood

bethskurrie
2019-02-01 09:34
@kong may be able to answer that.

hossam.saraya.ext
2019-02-01 09:38
I also wanted to ask you what are the possible use cases for webhooks? So what I have in mind for our CI pipeline is: *Consumer* - Defines and publishes contracts to broker at the end of the build *Provider* - Query the broker for contracts and test its ownself against the matching contracts - Publish verification results back to the broker - Pass if the verification succeeds, fail otherwise

hossam.saraya.ext
2019-02-01 09:39
Does this sound like the right way to use pact for you? @bethskurrie

bethskurrie
2019-02-01 09:39
Yes.


bethskurrie
2019-02-01 09:39
Webhooks will trigger the provider build when a contract changes

hossam.saraya.ext
2019-02-01 09:39
Yea it says that a use case would be to trigger builds on provider when contracts change

bethskurrie
2019-02-01 09:40
if you're running your provider ci regularly anyway, it's not such a big deal.

bethskurrie
2019-02-01 09:40
it's mostly useful when your provider is not under active development

hossam.saraya.ext
2019-02-01 09:41
mmm so what if the provider build fails...we will have the system in a contract-violating state after we deploy the consumer. yes?

hossam.saraya.ext
2019-02-01 09:42
because for us. QA, Staging environments auto deploy if the build passes. So for a consumer that violates the contract, the build will still pass and it will be deployed

bethskurrie
2019-02-01 09:48
so, you need the can-i-deploy tool

hossam.saraya.ext
2019-02-01 09:50
Okay so to use the `can-i-deploy` tool. I have to `verify` the provider against the updated/new contracts first?

matt.fellows
2019-02-01 10:00
yes, but if the contract hasn?t changed between consumer builds the broker knows and it will already be green (it also won?t fire the webhook for changed pacts, because it hasn?t changed)

hossam.saraya.ext
2019-02-01 10:02
makes sense. But for changed contracts, how can I asynchronously verify the provider from the consumer build? I am worried about deadlocks here. If I add pact verification as a build step in both consumer and provider..I might end up in a deadlock where both provider and consumer will fail

matt.fellows
2019-02-01 10:06
Well, the webhook is async and the consumer build shouldn?t know about the provider build going on (i.e. it shouldn?t wait for it or anythnig).

matt.fellows
2019-02-01 10:07
If a new expectation is added to the contract that has yet to be validated by its provider, it _will_ currently fail the contract test

matt.fellows
2019-02-01 10:07
so the branch wouldn?t be in a mergeable state just yet, but once the provider has gotten to it and verified, a rebuild on that branch should succeed

matt.fellows
2019-02-01 10:08
It?s a bit clumsy, to be fair, and we?re not far away from releasing a way to resolve that deadlock (currently called WIP pacts). Stay tuned

hossam.saraya.ext
2019-02-01 10:09
Okay but that means that for every contract change, the consumer has to fail once?

hossam.saraya.ext
2019-02-01 10:09
have I got it right

matt.fellows
2019-02-01 10:10
there are ways to automate that part (e.g. create a dependency on the contract testing step of the provider?s build), but given WIP pacts are coming my advice would be to not attempt it

bethskurrie
2019-02-01 10:10
We'd recommend putting your new expectations on a branch of the consumer

bethskurrie
2019-02-01 10:11
publish that to the broker, get the provider to verify it, then once it's green, merge in your feature branch into the consumer.

bethskurrie
2019-02-01 10:11
Because the pact will have been "pre-verified" when it was on a branch, it won't fail on master.

matt.fellows
2019-02-01 10:14
yes, sorry if that part wasn?t clear earlier. For some reason I thought branches had been discussed

hossam.saraya.ext
2019-02-01 10:14
mmm that makes sense I think. Only downside here is that it needs human interaction. I was looking for a way to have that check inside the consumer build (a way to ask the provider to verify without going into a deadlock). But you saying its WIP anyways right?

hossam.saraya.ext
2019-02-01 10:15
and since webhooks are async, we cant wait for it in consumer build

matt.fellows
2019-02-01 10:17
you can link builds together as noted, but that just creates a dependency tree that can get complicated very quickly for anything other than fairly simple architectures. Best to let builds fail and have humans review

hossam.saraya.ext
2019-02-01 10:17
cant I get away with: ``` - consumer publish contract - webhook triggers provider verifications - consumer sleeps ? - consumer polls `can-i-deploy` - consumer fails or succeed when `can-i-deploy` has new results ```

bethskurrie
2019-02-01 10:17
It seems to happen less often than you'd think.

bethskurrie
2019-02-01 10:18
You can poll can-i-deploy if you'd really like to - it's got built in retries for this.


matt.fellows
2019-02-01 10:18
of course, but that is still creating a dependency on another non-deterministic build. It can work, you can weigh up if the additional complexity is worth it in your environment

matt.fellows
2019-02-01 10:19
And I should note I?ve seen this done in a number of places to great success

matt.fellows
2019-02-01 10:19
in some environments, this just gets a bit messy. Keep an eye on it and change if it does

hossam.saraya.ext
2019-02-01 10:20
Okay I think you are right about creating a dep on a non deterministic build..I suspect that to get nasty at some point of future time

matt.fellows
2019-02-01 10:20
it tends to work nicely with new apps that have quick builds and a small amount of collaborators

hossam.saraya.ext
2019-02-01 10:20
I will ask our PR reviewers to check the broker UI first before merging a PR.

matt.fellows
2019-02-01 10:21
as this scales, you now could have multiple builds waiting for multiple other builds

bethskurrie
2019-02-01 10:21
you can actually get the webhook to post an update to the PR

hossam.saraya.ext
2019-02-01 10:21
exactly..which can feel like a circus


hossam.saraya.ext
2019-02-01 10:22
Ah thats really nice

hossam.saraya.ext
2019-02-01 10:23
Okay but from the provider side, we should have the pact verification as a build step and that would make the build fail if the verification fails. So thats still automated on the provider which is good

hossam.saraya.ext
2019-02-01 10:24
Thanks a lot for the insider help..you enlightened me :sparkles:

bethskurrie
2019-02-01 10:24
np

hossam.saraya.ext
2019-02-01 10:25
Still have questions related to the broker concept thou

hossam.saraya.ext
2019-02-01 10:26
so, do you think I should only spin up one broker for all the environments? In that case I would prefix service names like `staging-user-service` and `production-billing-service`..etc

hossam.saraya.ext
2019-02-01 10:26
The other option is to have a broker for each environment

bethskurrie
2019-02-01 10:26
you use tags to manage environments

bethskurrie
2019-02-01 10:26
single broker for all stages

hossam.saraya.ext
2019-02-01 10:27
ah and is there a filter in the UI where can I filter pacts by tag?


bethskurrie
2019-02-01 10:27
Yes, there is a filter, but it's got a poor UI

hossam.saraya.ext
2019-02-01 10:27
nop, will do now

bethskurrie
2019-02-01 10:28
that will explain about tags.

hossam.saraya.ext
2019-02-01 10:28
at some point I would like to contribute..maybe create a UI for you :muscle:

bethskurrie
2019-02-01 10:28
you tag a version with metadata that tells you about the branch it's on or the stage it's in (eg. "master" or "prod")

matt.fellows
2019-02-01 10:28
OooOH!

bethskurrie
2019-02-01 10:29
Then you can say "I want to verify the latest "master" pact" or "the latest production pact"

bethskurrie
2019-02-01 10:29
Any help with the UI would be appreciated. I initially didn't have the skillz, and now I just don't have the time, to make it look good.

hossam.saraya.ext
2019-02-01 10:30
I would def. love to help you out

hossam.saraya.ext
2019-02-01 10:31
https://dribbble.com/daedlock not so active on dribble but I share some stuff there.

bethskurrie
2019-02-01 10:32
Man, I am such a back end dev these days, I love it when front end devs want to do UIs for me!

bethskurrie
2019-02-01 10:32
I think I lost touch with CSS about 5 years ago and never caught up again.

hossam.saraya.ext
2019-02-01 10:32
there is no CSS now

hossam.saraya.ext
2019-02-01 10:32
there is styled components and CSS-in-JS

bethskurrie
2019-02-01 10:32
whatever the kids are using these days :stuck_out_tongue:

hossam.saraya.ext
2019-02-01 10:32
:smile:

hossam.saraya.ext
2019-02-01 10:33
yea frontend part of the world is changing faster than my brain can handle

hossam.saraya.ext
2019-02-01 10:34
Awesome!! I just need to know if I can assume that brokers ip is static or not. Otherwise I can't use the webhooks and I will have to run and maintain a local copy :disappointed:

matt.fellows
2019-02-01 10:35
No static IP, but can provide IPs for whitelisting

matt.fellows
2019-02-01 10:35
``` 13.210.164.235 13.210.66.183 13.211.59.138 13.54.130.12 54.252.242.229 54.66.180.72 13.236.113.160 54.252.233.246 ```

hossam.saraya.ext
2019-02-01 10:35
thats awesome man thanks

matt.fellows
2019-02-01 10:37
Just so we?re clear, the broker itself is not on a static address, but webhooks will come out via one of them

bethskurrie
2019-02-01 10:38
They use Magic.

hossam.saraya.ext
2019-02-01 10:41
great. are you using any frameworks on frontend? or is it just SSR with bootstrap

bethskurrie
2019-02-01 10:51
SSR

bethskurrie
2019-02-01 10:51
There's an api to create a js front end with though.

bethskurrie
2019-02-01 10:51
/dashboard

bethskurrie
2019-02-01 10:52
It would be good to do something in vue or react.

hossam.saraya.ext
2019-02-01 10:52
you can use `react-rails` if you are using rails

bethskurrie
2019-02-01 10:52
Something that a lot of people can contribute to for maintenance - the problem with the Ruby back end is that not many people use Ruby these days.

bethskurrie
2019-02-01 10:53
It's not rails.

bethskurrie
2019-02-01 10:53
And there are currently only 3 pages anyway!

bethskurrie
2019-02-01 10:53
Would be easy to rewrite.

hossam.saraya.ext
2019-02-01 10:55
I can imagine. Can't we generate api documentations from the contracts? Is it something you would consider?

bethskurrie
2019-02-01 10:57
How does that differ from the current HTML pact rendering?

hossam.saraya.ext
2019-02-01 10:59
idk I am thinking like a documentation with each service and its endpoints..etc

hossam.saraya.ext
2019-02-01 10:59
but that might sound silly since this is not what pact is about anyways

bethskurrie
2019-02-01 11:00
Swagger would do that better

hossam.saraya.ext
2019-02-01 11:00
agreed

bethskurrie
2019-02-01 11:00
We want to integrate swagger into the pact work flow better in thrle future.

bethskurrie
2019-02-01 11:01
It's late here in Australia, so I'll chat to you a other time.

hossam.saraya.ext
2019-02-01 11:01
Okay thanks a lot! ttys

bethskurrie
2019-02-01 11:02
I'd recommend starting with some wire frames and getting some feedback from the pact community on slack if you're interested in the UI. We actually need to start with a design exercise.

hossam.saraya.ext
2019-02-01 11:04
Will start on something this weekend. The pages we have are (pact list, pact view and network graph) I think I need to discuss this in a bit more details later to know what pages should be designed, what api endpoints we already have..etc

hossam.saraya.ext
2019-02-03 10:28
Okay I am back again to discuss the UI screens we have. I will start a designing a prototype for broker's UI but need more direction from you

hossam.saraya.ext
2019-02-03 10:36
Oh almost forgot that for me its an open source contribution and for you its a full time job :smile: so probably I won't be able to reach you guys on weekends -.-

matt.fellows
2019-02-03 11:02
> for you its a full time job :smile: well? no, we also have full time jobs too. This is our, not-paid-but-still-basically-full-time job :slightly_smiling_face:

hossam.saraya.ext
2019-02-03 11:43
that requires devotion man keep it up

hossam.saraya.ext
2019-02-03 11:43
any idea where should I start in regards to the UI?

bethskurrie
2019-02-03 20:35
Sure does.

bethskurrie
2019-02-03 20:37
I'd start by doing some wire frames. Put them in front of some of the users from the slack channel, get some feedback, and iterate.

bethskurrie
2019-02-03 20:37
Sorry, the time zone difference means you're ready to work on this when I'm in bed, unfortunately!

hossam.saraya.ext
2019-02-04 08:58
:smile:

hossam.saraya.ext
2019-02-04 14:05
Is it a good idea to use *git SHA* as consumer and provider versions?

yousafn
2019-02-04 14:13
I use short git sha plus a CI build version number, gives us the ability to reference a single commit, and know which build artefacts have been tested (as our deployable artefacts contain the CI build number)

hossam.saraya.ext
2019-02-04 14:14
> CI build version numbe good idea

hossam.saraya.ext
2019-02-04 17:06
~DELETED~

james.carman
2019-02-07 22:53
has joined #pact-broker

james.carman
2019-02-07 22:59
I think the problem I ran into before with all of this automation was that if the provider does not declare any pacts, the broker won?t have data on it. There?s nothing to tag

james.carman
2019-02-07 23:02
I need to make sure the production version of the provider is verified against my consumer pact

james.carman
2019-02-07 23:03
This is when trying to deploy a new consumer version into an environment

james.carman
2019-02-07 23:03
Am I missing something?

james.carman
2019-02-07 23:04
Being able to tag a provider version would work I suppose

james.carman
2019-02-07 23:06
@bethskurrie I think this was my conundrum before

james.carman
2019-02-07 23:07
I?m just getting back to getting pact integrated into our workflows

bethskurrie
2019-02-07 23:07
Sorry, I'm working right now.

james.carman
2019-02-07 23:07
K

bethskurrie
2019-02-07 23:08
Can you come up with a concise and complete description of your problem scenario, with an expected result, and the actual result

james.carman
2019-02-07 23:08
Whenever you have time. Thanks

james.carman
2019-02-07 23:08
I can try, sure

james.carman
2019-02-07 23:22
Part of our issue is we can?t use webhooks because we are using a hosted instance, which can?t reach our Jenkins box

abubics
2019-02-07 23:32
The provider doesn't need to declare any pacts (that's not really a concept) or tests . . . it just tells the broker which provider it is, so it knows which Pact scenarios to verify

james.carman
2019-02-07 23:36
I need to know which version to verify

james.carman
2019-02-07 23:41
Of the provider

abubics
2019-02-07 23:42
right, that's what the tags are for :slightly_smiling_face:

james.carman
2019-02-07 23:42
I understand that the provider doesn?t declare pacts and they?re not supposed to

james.carman
2019-02-07 23:43
The issue is I need to know that the right version (the production version) of the provider is verified against my pact

james.carman
2019-02-07 23:43
How do I know what is the production version of the provider?

abubics
2019-02-07 23:46
To clarify, you want to know what the provider version is for the latest `prod` tag on a pact version?

james.carman
2019-02-07 23:47
Before I deploy a consumer to production, I need to make sure its pacts have been verified against all of the production versions of the providers

james.carman
2019-02-07 23:47
That?s the general concept

james.carman
2019-02-07 23:48
I?m trying to figure out if tags (alone) can solve this problem

james.carman
2019-02-07 23:48
If they provide enough state

james.carman
2019-02-07 23:49
The only place a provider version shows up is when they verify a pact

james.carman
2019-02-07 23:49
There?s a version associated with that verification

james.carman
2019-02-07 23:51
But there doesn?t appear to be a way to declare that a specific provider version is the production version

james.carman
2019-02-07 23:51
Make sense?


abubics
2019-02-08 00:01
1. When a provider verifies a pact version, the provider's version is listed in the matrix. 2. When a verified pact version is promoted to a prod environment, it should push the `prod` tag to that pact version. 3. Now any consumer changes have an updated prod provider version to verify against.

abubics
2019-02-08 00:01
Is this workflow missing something for you?

abubics
2019-02-08 00:01
For example, do you have multiple live prod versions?

abubics
2019-02-08 00:01
(that's a real use case sometimes)

abubics
2019-02-08 00:02
(You still need to add the `prod` tag when the provider is promoted to prod. Nothing in Pact can do that for you, of course)

james.carman
2019-02-08 00:35
It doesn?t even need to be multiple prod versions.

james.carman
2019-02-08 00:35
The issue is that I have no way of knowing what is the production version of the provider

james.carman
2019-02-08 00:37
The pact, and the tags associated with it are meant to be associated with the consumer that uploaded the pact

james.carman
2019-02-08 00:37
There is no tag for a provider

hossam.saraya.ext
2019-02-08 01:09
I think the tag is associated with a ?pact? not a service. The provider would then verify itself against the latest ?prod? pacts. Someone correct me if I am wrong

hossam.saraya.ext
2019-02-08 01:15
If all is green, you deploy. If you do a CD and deployments doesnt happen manually. I think the flow would be 1. Consumer changes and publish new pact to brokee 2. Broker trigger a build on the provider via a webhook 3. You use can-i-deploy as a consumer build step. If it succeeds, deploy. Otherwise exit with non-0

hossam.saraya.ext
2019-02-08 01:17
Cant you whitelist the brokers ip on your jenki ns box? I think webhooks is needed for having the flow you need

abubics
2019-02-08 02:32
You're right, @hossam.saraya.ext, tags go on Pact versions. Pacts are versioned by content, so if multiple versions of consumers have the same Pact content, no extra work needs to happen. Likewise, if a provider has verified one version of a Pact, all future verifications automatically happen until the content changes again.

abubics
2019-02-08 02:33
If you wanted to have `consumer-prod` and `provider-prod` as separate tags, I guess you could, but I'm not sure what that solves.

james.carman
2019-02-08 04:49
The trick is that the specific version of the provider needs to verify the pact

james.carman
2019-02-08 04:49
The version that?s in production

james.carman
2019-02-08 04:51
Yes, the pact is what?s tagged, but the pact comes from the consumer. So, the tag on the pact is really within the context of a version of the consumer.

james.carman
2019-02-08 04:53
I?m not trying to be difficult. I?m just trying to figure out if I can safely certify that a consumer works with the versions of the providers that it is about to be deployed with

abubics
2019-02-08 05:04
I'm sure you can, have you looked at the matrix? It shows every combination of consumer version that either - hasn't been verified by any provider version, or - has been verified, and which version it is

abubics
2019-02-08 05:04
If you need that info by an API or CLI tool, I'm not the best person to direct you, but maybe one of the actual maintainers :slightly_smiling_face:

james.carman
2019-02-08 05:25
Oh I?m sure the matrix can tell me the answer. But, I need to know which specific combination(s) to look for.

james.carman
2019-02-08 05:26
It?s all about that provider version

james.carman
2019-02-08 05:26
I need to know which version of the provider to check

abubics
2019-02-08 05:33
I must still be missing something . . . if the matrix can tell you the answer, what outstanding issues do you have? Maybe describe the usage context?

abubics
2019-02-08 05:33
I mean, if the info's in there, I'm sure you can get it out somehow.

james.carman
2019-02-08 05:38
I need to know what question to ask it, which cell to look for in the grid.

james.carman
2019-02-08 05:46
I mean programmatically, by the way. Of course we know (or can easily determine) what version of our stuff is running where.

rjmcguinness
2019-02-08 09:52
has joined #pact-broker

bethskurrie
2019-02-08 20:05
We can give you a list of IPs to white list @james.carman

james.carman
2019-02-08 20:43
That can certainly help with our automation. Let me ping our ops guys and see if they?re down with that

hossam.saraya.ext
2019-02-09 11:19
pact screen first concept. Feedback & suggestions are much appreciated

rafael.anachoreta
2019-02-12 12:13
has joined #pact-broker

pkuang
2019-02-14 16:47
has joined #pact-broker

pkuang
2019-02-14 16:57
Hi! I was wondering if someone can comment on the prospect of this proposed feature: https://github.com/pact-foundation/pact_broker/issues/248 This would be useful for my CI/CD use case where I have a consumer change in a branch that requires verification from the provider version in prod. However this may fail if the corresponding change hasn't been deployed to prod yet. However, once the provider has deployed to prod and we know the consumer branch change is compatible, can-i-deploy will still fail since the provider verification build wasn't rerun against the consumer branch contracts. It would be useful if we were able to simply re-run the consumer branch build (which would republish the same contract) and have the webhook trigger the provider verification build via a 'contract_published' event that fires regardless of whether the contract has changed.

tomw
2019-02-15 16:54
has joined #pact-broker

bethskurrie
2019-02-18 02:09
This looks amazing!

bethskurrie
2019-02-18 02:09
I though you were just going to do the index page.

bethskurrie
2019-02-18 02:11
This would be quite easy to do. It's just a matter of having the free time to do it, which I don't have a lot of right now.

bethskurrie
2019-02-18 02:11
If you're keen enough to do a PR, I can show you where the code would need to change.


bethskurrie
2019-02-18 02:12
I remember I deliberately made the event "CONTRACT_CONTENT_CHANGED" instead of PUBLISHED so that we could add one for PUBLISHED later.


bethskurrie
2019-02-18 02:15
Adding the event to this list should allow the API to accept the new value: https://github.com/pact-foundation/pact_broker/blob/master/lib/pact_broker/webhooks/webhook_event.rb#L14

hossam.saraya.ext
2019-02-18 08:30
That wont be a good idea. we should create some identity thats visible on all pages

bethskurrie
2019-02-18 08:30
Even better than I had hoped.

hossam.saraya.ext
2019-02-18 08:30
Right now the kind of identity we have is ?made with bootstrap? :D

bethskurrie
2019-02-18 08:30
Sad but true

bethskurrie
2019-02-18 08:31
I can't see the index page mock up though

bethskurrie
2019-02-18 08:31
It seems to have been deleted.

hossam.saraya.ext
2019-02-18 08:31
Yea I havent worked on it yet

hossam.saraya.ext
2019-02-18 08:31
Its still wip

bethskurrie
2019-02-18 08:31
no problem!

hossam.saraya.ext
2019-02-18 08:31
So i think index page and the pact matrix page

bethskurrie
2019-02-18 08:32
One concern I'd have with putting the request and response side by side is that deeply nested JSON might end up being squished.

bethskurrie
2019-02-18 08:32
It looks great with a simple example, but might not scale for real world data.

hossam.saraya.ext
2019-02-18 08:32
Yea good point

hossam.saraya.ext
2019-02-18 08:33
We might want to test it against real data

hossam.saraya.ext
2019-02-18 08:33
We can parse the json and show it as a tree

bethskurrie
2019-02-18 08:33
I might be able to find some real data and obfuscate it.

hossam.saraya.ext
2019-02-18 08:33
So we have both text and tree view. But that doesnt totally fix the indentation hell

bethskurrie
2019-02-18 08:34
Have you worked with the v3 pact spec where there are multiple provider states, and provider state params?



hossam.saraya.ext
2019-02-18 08:35
Nope havent seen that. I might need you to walk me through the broker to point out the core ui interactions

bethskurrie
2019-02-18 08:36
That format is not even currently supported by the broker.

bethskurrie
2019-02-18 08:36
Really, there are only 4 pages. The index, the network diagram, the matrix, and the pact itself.

hossam.saraya.ext
2019-02-18 08:39
Yea thats what I thought. I think the matrix is interesting. I will think of another way to present it beside the tabular format

hossam.saraya.ext
2019-02-18 08:43
Do you think we should have a brand primary color. Or you are already settled on ?black??

bethskurrie
2019-02-18 08:44
I have no preference!

bethskurrie
2019-02-18 08:44
I do quite like the b/w, as it's striking, and doesn't look like anything else I've seen.

bethskurrie
2019-02-18 08:45
Given that the matrix by it's nature is very tabular, i'm curious as to how else it could be presented.

bethskurrie
2019-02-18 08:45
It's the epitome of relational data.

hossam.saraya.ext
2019-02-18 08:45
Yea. Will try to get outside the box :package:

bethskurrie
2019-02-18 08:46
I can see the index being presented as cards.

bethskurrie
2019-02-18 08:46
I think there's a lot that could be done with that, but the matrix... I can't quite imagine. I'll look forward to seeing what you come up with though.

bethskurrie
2019-02-18 08:47
Something to note with the index is that there is the simple view, and the tags view.

hossam.saraya.ext
2019-02-18 08:48
I think we should combine both views because they are ultimately the same. And maybe have a switch ?show with/without tags?

bethskurrie
2019-02-18 08:48
I'd actually like to have the tags on the default view, and not have the 'simple' view. But making the space for each pact allow you to have multiple tags for the consumer and provider versions was quite tricky for us (we have done some work on the UI at DiUS for the commercial broker, but we haven't gotten it in to prod yet)

hossam.saraya.ext
2019-02-18 08:48
Also having autocomplete for tags and versions

bethskurrie
2019-02-18 08:49
The matrix and index are not the same - the matrix is every combination of two particular services.

bethskurrie
2019-02-18 08:49
They have a lot of overlap, it's true.

hossam.saraya.ext
2019-02-18 08:49
Yea I meant the tags view. The mateix deserves its own space

hossam.saraya.ext
2019-02-18 08:50
Its probably the core view where users spend the most time

bethskurrie
2019-02-18 08:50
Ah yes - I'd like to retire the no-tags view.

hossam.saraya.ext
2019-02-18 08:50
Or at least me :D

bethskurrie
2019-02-18 08:50
Yes, I think most people do.

hossam.saraya.ext
2019-02-18 08:52
Also I noticed that searching the matrix by tag & latest version doesnt work

hossam.saraya.ext
2019-02-18 08:52
idk if I am doing something wrong

hossam.saraya.ext
2019-02-18 08:52
But I always get an empty result

bethskurrie
2019-02-18 08:52
there may not be a result for that combination

bethskurrie
2019-02-18 08:53
do you mean tag for one, and latest version for the other?

hossam.saraya.ext
2019-02-18 08:53
No. Tag and latest version for both contractees

bethskurrie
2019-02-18 08:53
you can't enter both.

hossam.saraya.ext
2019-02-18 08:53
Why not?

bethskurrie
2019-02-18 08:53
you can say, "latest version with tag" or "latest version"

bethskurrie
2019-02-18 08:54
it doesn't make sense.

bethskurrie
2019-02-18 08:54
Can you give me a screenshot? Maybe I'm misunderstanding you.

hossam.saraya.ext
2019-02-18 08:54
Yep. Gotta jump in a quick meeting now but will post a screenie right after

bethskurrie
2019-02-18 08:54
ok

hossam.saraya.ext
2019-02-18 13:34
Okay it works when I apply the filter to one participant only (the consumer)

hossam.saraya.ext
2019-02-18 13:34
Conceptually, is the tag related to a participant or a pact?

hossam.saraya.ext
2019-02-18 13:35
I know that each participant can have versions..but what about the tags? Do we tag a participant or do we tag a pact?

mail
2019-02-20 11:05
has joined #pact-broker

lukas.mrtvy
2019-02-21 12:36
has joined #pact-broker

lukas.mrtvy
2019-02-21 12:36
Does Pact Broker provide healthcheck or metrics endpoint for Prometheus?

dagarwal
2019-02-21 13:31
has joined #pact-broker

oswald.quek
2019-02-21 16:06
has joined #pact-broker

m.r.green
2019-02-25 09:05
has joined #pact-broker

kajan.siva
2019-02-25 14:51
has joined #pact-broker

pkuang
2019-02-26 16:33
Hi @bethskurrie, can you review https://github.com/pact-foundation/pact_broker/pull/258 when you get the chance please?

kajan.siva
2019-02-26 19:08
@kajan.siva has left the channel

ragarwal
2019-02-27 06:03
Hello, I have a question: I want to use the pact broker interface and features but can?t use its own db. Is it possible to provide the data via some api?

bethskurrie
2019-02-27 06:04
What problem are you trying to solve?

ragarwal
2019-02-27 06:07
we are doing contract testing is a way where consumer side writes pacts but the provider side is using swagger files for verification. Company has its own contract-testing-cli which does all the validation work. The cli is a command line tool and prints everything on console which is not easy to consume. I really like the power pact_broker has and all the details it provides. Just trying to understand how can we use it in our setup?

bethskurrie
2019-02-27 06:07
You can publish any JSON contract to the broker. It doesn't have to be a pact.

bethskurrie
2019-02-27 06:08
Sounds like you're using the swagger validator from atlassian?

bethskurrie
2019-02-27 06:08
We're actually adding support for swagger documents in the DiUS commercial broker. cc @matt.fellows

pltran875
2019-03-01 23:07
has joined #pact-broker

mouser
2019-03-04 04:55
hi, just wondering if there has been any change in behaviour around webhooks for the hosted pact broker? we seem to be having webhooks triggered even if the contract hasn?t changed??

matt.fellows
2019-03-04 05:02
Not that I?m aware of, but I know others have had that issue if they use matchers with defaults as the library generates new dates/integers etc. each time

bethskurrie
2019-03-04 05:04
you can see what has changed by going to the pact in the API browser, then clicking on the `pb:diff-previous-distinct` relation.

mouser
2019-03-04 05:04
yeah we?ve had that issue before and are generally fairly careful to provide fixed examples when writing our tests

bethskurrie
2019-03-04 05:04
@mouser ^^

bethskurrie
2019-03-04 05:05
See what version it thinks the previous distinct version is.

mouser
2019-03-04 05:05
we?ve just noticed in the last few days that at times our build monitor lights up with what appears to be multiple webhooks being triggered?. we manually diff?ed one in particular and could see no difference other than the published date

mouser
2019-03-04 05:05
ok, i?ll try that

matt.fellows
2019-03-04 05:15
Interesting, perhaps it?s that issue above?

bethskurrie
2019-03-04 05:41
Any luck @mouser?

mouser
2019-03-04 21:54
Not yet?. I found one of our javascript pact tests was using a dynamic timestamp that was causing one provider to be unnecessarily run?.

mouser
2019-03-04 21:55
but i?m still looking into some of the others

bethskurrie
2019-03-04 21:59
If you can't identify the reason, I can add some logging so we can see what the broker thinks the diff is.

mouser
2019-03-04 22:51
Ok? let me keep a bit more of an eye on things over the next day or so and I?ll try to get more details about when it?s happening. It doesn?t seem to be happening on all consumer builds so I suspect it might be an incorrectly configured service or webhook somewheere

mouser
2019-03-04 22:51
thanks beth!

josh.mccure
2019-03-05 01:06
has joined #pact-broker

bethskurrie
2019-03-05 02:59
np

rabih
2019-03-05 06:17
has joined #pact-broker

rabih
2019-03-05 06:17
Hi, is it possible to force the name for consumer/provider instead of getting this message(other than creating manually): The name ?ServicesProvider? is very similar to the following existing consumers/providers: * providers_api If you meant to specify one of the above names, please correct the pact configuration, and re-publish the pact.

bethskurrie
2019-03-05 06:24
There should be more information in that error to tell how to fix it.

bethskurrie
2019-03-05 06:24
You can turn off the duplicate detection.

bethskurrie
2019-03-05 06:25
Services Provider is very vague! Are sure it's the best name?

bethskurrie
2019-03-05 06:26
Also which library and version are you using to publish the pact?


rabih
2019-03-05 06:29
Hi Beth, yes this is the message that we got, also note that we are using the hosted pact broker so we could not chanbe the config

bethskurrie
2019-03-05 06:30
Oh right

bethskurrie
2019-03-05 06:30
Can I actually suggest that in this case, your names are very vague, and perhaps changing them to be more descriptive of what the services does might kill two birds with one stone?

rabih
2019-03-05 06:31
so is there any way to add this check when initialising dsl.Pact or when publishing

bethskurrie
2019-03-05 06:31
Is this actually a provider that returns information about other providers?

rabih
2019-03-05 06:31
yes we are changing the names

rabih
2019-03-05 06:32
we are following a convention of `servicename_type` so for example a service named triggers that has api providers would be triggers_api

rabih
2019-03-05 06:33
we have also services that use MQ integration tests, named like control_mq

bethskurrie
2019-03-05 06:34
As an aside, a client I was at banned the use of "service" and "api" in the name, because they felt it was redundant.

bethskurrie
2019-03-05 06:34
You shouldn't have problems calling things foo_api bar_api

bethskurrie
2019-03-05 06:35
If you do, I can update the logic.

bethskurrie
2019-03-05 06:36
I may be able to turn this off for your broker specifically if you continue to have problems.

rabih
2019-03-05 06:36
that would be appreciated

bethskurrie
2019-03-05 06:37
Can you send an email to about this please?

rabih
2019-03-05 06:37
ok sure thank you

rabih
2019-03-05 06:38
I will just also send the pact url, any further details from my side?

bethskurrie
2019-03-05 06:39
I just need to know your broker. You'll need to send it from an email address that matches the original registration domain if it's for a company.

rabih
2019-03-05 06:39
ok sure

bethskurrie
2019-03-06 07:47
@hossam.saraya.ext the tag belongs to the version

bethskurrie
2019-03-06 07:48
There's a really good doc on versioning in the broker on http://docs.pact.io

rabih
2019-03-06 12:09
Hello @bethskurrie , any updates regarding this issue, still getting the same message

vinod.baradwaj
2019-03-07 10:19
is it possible to `delete` webhooks that are already created or update it ? when i try to `delete` i get 405 error ?

matt.fellows
2019-03-07 10:19
Yes, of course. What resource are you trying to delete?

vinod.baradwaj
2019-03-07 10:21
i have created webhook for pb:create.. i want it to be deleted

bethskurrie
2019-03-07 10:22
Go to /webhooks

bethskurrie
2019-03-07 10:23
Find the one you want, and send delete to it.

vinod.baradwaj
2019-03-07 10:24
these are the entries i have in webhooks

bethskurrie
2019-03-07 10:25
Why aren't you using the api browser?

vinod.baradwaj
2019-03-07 10:25
it worked.. thanks @bethskurrie @matt.fellows :+1:

matt.fellows
2019-03-07 10:25
So you would delete the only webhook in that list

matt.fellows
2019-03-07 10:25
:thumbsup:

vinod.baradwaj
2019-03-07 10:31
I am trying to setup webhooks to trigger provider build on jenkins, so trying out different combinations, still not able to trigger the provider build. is it possible to get status of webhooks ?

matt.fellows
2019-03-07 10:31
yes

matt.fellows
2019-03-07 10:32
Navigate through the HAL API and you should be able to see the status and any logs associated with it

vinod.baradwaj
2019-03-07 10:32
it says `success` still in jenkins the build has not triggered

matt.fellows
2019-03-07 10:32
what do the logs say?

bethskurrie
2019-03-07 10:33
From the index page, you'll see a link to the Webhook status for that pact. Follow those links, and you'll find the execution logs for the Webhook.

bethskurrie
2019-03-07 10:33
Also, remember the Webhook is only triggered when the pact changes.

matt.fellows
2019-03-07 10:34
But you can manually trigger it, which is useful for debugging

vinod.baradwaj
2019-03-07 10:57
in status it says `success`.. yes @matt.fellows i triggered manually.. but not sure whats the actual issue in calling the jenkins build

matt.fellows
2019-03-07 10:58
What do the logs say?

vinod.baradwaj
2019-03-07 11:23
i see only this @matt.fellows

matt.fellows
2019-03-07 11:24
Even if you click the link for ?Webhook execution logs??

vinod.baradwaj
2019-03-07 12:15
some authentication issue??

vinod.baradwaj
2019-03-07 13:41
fixed it... thanks @matt.fellows :slightly_smiling_face:

matt.fellows
2019-03-07 23:22
np, what was it?

joguespermana
2019-03-11 02:15
has joined #pact-broker


vinod.baradwaj
2019-03-11 14:00
i was not using the correct url with `/build`

oswald.quek
2019-03-12 14:35
:wave: is there an endpoint in the pact broker to delete pacts that are older than a certain date?

davidjgmendes
2019-03-13 14:37
has joined #pact-broker

davidjgmendes
2019-03-13 14:43
@yousafn sry for digging up this old thread, but your use case interested me and brought up some questions. You mentioned your use of WireMock alongside CDC testing. My question is on the scope of each of the tests. Are the tests using WireMock functionally testing the service that is consuming the mocked service ? And how do you make sure the WireMock mocks keep parity with the evolving contracts. Thanks in advance for any input on this.

alisdaircole
2019-03-13 16:38
has joined #pact-broker

yousafn
2019-03-13 16:46
Hi mate, no problem. It was a big struggle to ensure our wiremock mocks, we kept in sync with our documentation, as we weren?t writing api documentation up front and using generated swagger from the services to document the functionality. If I?m honest it was a massive cluster-fuck, and we built wiremock provider mocks as the providing teams weren?t engaged or bothered about providing these. this tool supports validating wiremock against swagger https://bitbucket.org/atlassian/swagger-request-validator/src/master/ My use case for my current client is documented in the following blog with an example repository showing how we are keeping our pact and swagger contracts in sync https://you54f.wordpress.com/2019/02/19/protecting-your-api-development-workflows-with-swagger-openapi-pact-io/ https://github.com/YOU54F/pact-consumer-example-typescript

yousafn
2019-03-13 16:48
the wiremock representations were similar to the pact approach, however our mocks would return a full response body and not just the bit we were interested in. Our test would check that our expectation was being met (as in the particular piece of data from the response was available) Pact seems to address alot of the issues but it all hinges on collaboration, if you don?t have that, it is never going to mesh well

yousafn
2019-03-13 16:54
just to add, because we didn?t trust our providers and because there was no collaboration, and we didn?t have a view of their changes, we should run a set of tests against their service every hour. A failure meant the request or response structure had changed, and we then needed to assess the change, and the impact it had on us.

davidjgmendes
2019-03-13 16:59
Thanks for the insight, it's really helpful . Will analyse the links you have sent. Much appreciated :pray:

yousafn
2019-03-13 17:02
Any time mate, I have been meaning to write up about my experiences in my last company, I?ve got an example repo that I keep meaning to polish up and get it up on github to demonstrate how we were using it for CDC, but I don?t think it is of much use anymore because I would advocate the use of pact and its supporting toolset to anyone doing cdc testing, bearing in mind the considering of pacts limitations listed in the FAQ of what it is not good for (pass through apis/public api?s)

bethskurrie
2019-03-13 22:34
@hossam.saraya.ext someone has raised an issue asking for pagination on the index page of the broker. I thought I'd check where you're up to in your UI redesign before I spend any time updating the current page.

davidjgmendes
2019-03-14 11:08
In your blog-post you mention "So we are now using our PACT contracts, that we generated, to perform our component integration and e2e testing, with mocks". Are these pact defined interactions enough to functionally test the consumer service ? And if so, don't you end up with contracts that are too tight ? Guiding myself mostly through the PACT Docs here. For component testing is where I would resort to implementing wiremocks instead of resorting to the contracts, my issue is the ability to make sure wiremocks are in sync with the pacts / swagger. From what i have seen from the tool you have referenced it only works if we are defining wiremocks through java (not my case) and I'm looking for a more language agnostic solution. Still, imo it's a great workflow that you have managed there :thumbsup:

yousafn
2019-03-14 15:17
We are functionally testing our consumers with our pact mocks but we are using request matchers to ensure that we are loose with the data our mock provider accepts, (instead of expecting an exact string, it uses a matcher to take any string) so we are interested in checking the structure of the message and only return information defined in an integration test plan, so we can ensure that our data we have defined for our provider states is in sync with the real provider when it is developed. We try and push as much of our testing, as far down the stack as possible, and we use cypress for our e2e and UI tests, but only run a few full stack journeys and stub out responses for the test to provide more granular control. Wiremock is nice, it provides really fine control of your mocks, however I would advise that if you want to use it, that you get your providers to produce the mock, and therefore you as a consumer, you don?t have to worry about keeping a full mock stood up (where you may only care about a tiny portion of an entire response returned). We had to also have a suite of tests, that tested that wiremock behaved as we expected it to, especially when we had developers/testers adding more scenarios, as sometimes they would conflict and not provide expected responses (as a new matcher may be at a higher priority level than your existing mocks)

yousafn
2019-03-14 15:25
Can we set the title of a webhook when registering it with the pact broker? https://github.com/pact-foundation/pact_broker/blob/master/lib/pact_broker/doc/views/webhooks.markdown The webhooks I have added to circleci and slack reporting both appear with a title of `title: "A webhook for all pacts",` when viewed via the `/webhooks` endpoint. I have tried adding title inside the body element, and outside to no avail. Danke

yousafn
2019-03-14 15:32
Actually, doing some more digging, I believe it is not currently implemented. https://github.com/pact-foundation/pact_broker/issues/136 I have 4 webhooks currently, two for circleci and two for slack (one for publisher verification, and one for contract changed) and it isn?t easy to distinguish which one is which. Will take a look at the issue and files that need changing and see what I can do. I am not familiar with Ruby, so if I do propose a PR, go easy on me :thumbsup: :stuck_out_tongue:

yousafn
2019-03-14 17:42
Another one, now that I have created my webhooks, the sensitive information in the URL?s (CircleCI token and Slack webhook URL) is exposed to readonly users. They can navigate to `/webhooks` and then click on the href under pb:webhooks and it is exposed. Is there any way I can whitelist this for read-only users


thirumal.net
2019-03-15 01:55
*how to connect to RDS Postgres Database from Dockerized pact broker which is deployed in aws EC2 Instance *? i am able to run both pactbroker and postgres docker images successfully in EC2 instance. publishing and verfifcation is working fine but i am facing issue if want to use external AWS RDS database like postgres . i am following below steps but unable to run frontend pact broker 1) Created RDS DB with credentials 2) running pact broker front end docker image in EC2 successfully 3) *how to make sure Pact broker front end application is talking properly with Postgres DB which is not dockeized* i have inspected docker id of frontend pact broker and it has proper usernames/pwd which i executed from rancher "Env": [ "PACT_BROKER_DATABASE_USERNAME=postgres", "PACT_BROKER_DATABASE_PASSWORD=pwd", "PACT_BROKER_DATABASE_HOST=http://pactbroker.c16kmrwxzbxe.us-west-2.rds.amazonaws.com", "PACT_BROKER_DATABASE_NAME=pactbroker", "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "DEBIAN_FRONTEND=teletype", "LANG=en_US.UTF-8", "LANGUAGE=en_US:en", "LC_ALL=en_US.UTF-8", "APP_HOME=/home/app/pact_broker/" reason i am not using dockerized pact broker is to get the benefit of RDS autobackup, high avilability, scalability ..etc *please help me what are my next steps to make sure pactbroker is talking with backend postgres database*

richard.jones
2019-03-15 03:18
Our pact broker is currently returning ```{ error: { message: "undefined method `name' for nil:NilClass" } }``` for requests to `/dashboard` ? any ideas?

bethskurrie
2019-03-15 03:18
:thinking_face:

bethskurrie
2019-03-15 03:19
Look at your logs for more info.

richard.jones
2019-03-15 03:19
I?ll see if I can get to them, yep

bethskurrie
2019-03-15 03:21
Have you considered signing up for a free hosted version at http://pact.dius.com.au @thirumal.net?

bethskurrie
2019-03-15 03:23
I really cannot comment on your AWS set up as there are many reasons why your set up may be failing (firewall, policies, VPN access). You need an AWS ops person to help you.

richard.jones
2019-03-15 05:41
@bethskurrie we?ve apparently seen this previously with bad pacts that were uploaded to the broker. We?ll be looking into it on Monday to figure the specific pact that is causing the issue this time.

bethskurrie
2019-03-15 05:42
That was my gut feel, because a consumer/provider is really the only thing with a name

thirumal.net
2019-03-15 17:14
@bethskurrie -Thank you beth, i have to add AWS host IP to inboud rule of RDS , then it started working fine.

thirumal.net
2019-03-15 17:24
@bethskurrie -Regarding http://pact.dius.com.au - i have recommended this pact broker but my management asked me whether this is hippa compliance or not . can you please direct me where can i see this hippa info

yousafn
2019-03-17 14:18
Hey @thirumal.net. I would change your credentials and security settings. Your pact database looks like it is accessible publicly. (ie the postgres port is open) I am happy to answer any questions about AWS Setup has I have a pact-broker hosted on AWS EC2 instance, with an RDS postgres DB. You should ensure your database isn?t given a public IP and put it on a VPC accessible to your EC2 instance only. Setup seperate security groups for your pact broker db and your pact broker ec2 instance. Did you have an ELB? if so you can sign your certificates with amazons cert manager, otherwise you need to roll your own as you can?t use amazons cert manager with your own ec2 instance. I am going to do a write up in a few days, as I have had just had to toughen our security up at work to get it compliant and want to share back my knowledge

sergiy
2019-03-17 14:34
has joined #pact-broker

richard.jones
2019-03-18 02:50
@bethskurrie if it helps, I can privately supply you with our database dump for the above ^^

bethskurrie
2019-03-18 02:54
Yes thanks. I can't see how you can be getting a nil there.

bethskurrie
2019-03-18 02:54
``` Pacticipant.find(id: PactBroker::Pacts::AllPactPublications .where(pact_version_id: pact_version_id) .limit(1).select(:provider_id)) ```

bethskurrie
2019-03-18 02:55
There should not be a way that can be nil, so there's obviously some data combination that I haven't thought of happening in your database.

bethskurrie
2019-03-18 02:55
you can send it to

richard.jones
2019-03-18 02:58
Yep. I?m poking around the database and I can?t see it either, though I?m not confident I?m reading the Ruby code correctly!

richard.jones
2019-03-18 02:59
dump sent!

bethskurrie
2019-03-18 02:59
If I have the db, I'll just put a debug point at that line and it should explain what the problem is.

thirumal.net
2019-03-20 06:17
@yousafn -Thank you for your reply. i have tried for ELB in AWS but some reason it is not working.. i am doing pact broker infrastruture task where i am playing with RDS but as you mentioned i need to change security setting for db. please share your article once you are completed -Thanks

yousafn
2019-03-20 20:40
Hi mate, I have written something up here https://you54f.wordpress.com/2019/03/19/securing-the-pact-broker-with-nginx-letsencrypt/ But it doesn?t talk about securing your rds database If you are just using an ec2 with docker instance of the pact broker and your rds Postgres instance - ensure your database doesn?t have a publicly accessible endpoint ( you can do this via rds console), - stick it on the same vpc as the ec2 instance - set up 2 security groups, one for the ec2 instance to allow http or https traffic. One for your database. - for your db security group ensure it can exposes only the Postgres post and limit access to the ec2 security group - if you need ssh access to your ec2 instance, limit access to your IP ( ideally your work will have a fixed IP ) - if you need to open it up to access from anywhere, then add 2 factor auth to your ssh session and use fail2ban to parse your logs for ssh brute force attacks and exclude the ip addresses via iptables Regarding running on an ELB, ideally use cloud formation templates. You want to clear a cluster with a network stack including vpcs, route 53 for dns and roles with ecs access to execute the containers, then service template?s to run fargate ecs and rds tasks. Deploy via AWS-cli to allow you to pass in environment variables at runtime into the docker container for the pact broker to pick up. Additionally you can store your env vars in amazons parameter store This is a good place to start for the CF templates. You can deploy your db with CF templates too https://github.com/nathanpeck/aws-cloudformation-fargate#private-subnet-public-load-balancer Unfortunately I can?t share my work CF templates. Best of luck with playing with AWS but please do be mindful that you don?t want to leave your resources insecure for too long. Feel free to drop me a pm if you want help with any specifics.

vitaliy.grigoruk
2019-03-21 11:56
has joined #pact-broker

richard.jones
2019-03-21 23:14
We?re seeing a really confusing issue here, wondering if others have also seen it. If we fetch the HTML view of a pact and the JSON view, the contents of the pact differ. There have been many revisions of the pact uploaded.

bethskurrie
2019-03-21 23:15
that should not be possible because they go through the same resource.

bethskurrie
2019-03-21 23:15
The code is exactly the same - the renderer differs.

bethskurrie
2019-03-21 23:15
also, sorry, I haven't had a chance to try out your db on the old code.

bethskurrie
2019-03-21 23:15
Life has been a bit hectic.

bethskurrie
2019-03-21 23:16
Can you provide some data for me?

richard.jones
2019-03-21 23:17
I don?t believe the pact exhibiting this issue is in the snapshot I provided previously, the pact is only a couple of days old. I?ll ask for a fresh snapshot :slightly_smiling_face:

bethskurrie
2019-03-21 23:17
Are you using the same URL exactly?


bethskurrie
2019-03-22 08:26
Question for broker users. I'm improving the messages in the can I deploy results, that explain why an app can't be deployed.

bethskurrie
2019-03-22 08:28
These two options describe the same situation - which one makes more sense (esp for users who are not familiar with the underlying domain model) 1. Version xyz of SomeApp does not exist. 2. No pacts or verifications have been published for version xyz of SomeApp.

vitaliy.grigoruk
2019-03-22 08:37
IMHO, option #2 is better.

bethskurrie
2019-03-22 08:44
Mm. I was leaning towards that. 1 is technically correct, but I think 2 is probably more helpful.

vitaliy.grigoruk
2019-03-22 08:54
option 2 gives a hint about a possible reason, while option 1 just says that it doesn?t exist.

bethskurrie
2019-03-22 08:54
:+1:

arunkumarpoonia
2019-03-22 09:25
has joined #pact-broker

arunkumarpoonia
2019-03-22 10:27
how to publish result with this image - image: dius/pact-provider-verifier-docker?


arunkumarpoonia
2019-03-22 10:28
@bethskurrie can you please help here ?

bethskurrie
2019-03-22 11:09
I suspect you can't

bethskurrie
2019-03-22 11:09
We may need to add that feature

arunkumarpoonia
2019-03-22 11:11
are you planning to add that feature ?

arunkumarpoonia
2019-03-22 11:27
how to publish pact verification result to broker ?


arunkumarpoonia
2019-03-22 13:34
@bethskurrie I am unable to use pact-provider-verifier to verify pacts from broker .

arunkumarpoonia
2019-03-22 13:36
I am running this command - ./pact-provider-verifier --PACT_URL=baseURL/pacts/provider/catalogApi/consumer/magento/latest -h, --provider-base-url=providerURLi

arunkumarpoonia
2019-03-22 14:41
guys

arunkumarpoonia
2019-03-22 14:42
I am unable to verify pact with pact-provider-verifier .

arunkumarpoonia
2019-03-22 14:42
any help will be appreciated ?

rjmcguinness
2019-03-22 16:27
The pact team is based in Australia, so I expect you?ll need to wait till this evening (if you?re in Europe)

matt.fellows
2019-03-22 20:45
I've just responded. Look more carefully at the CLI flags, you've just got them a bit wrong.

mwroblewski
2019-03-24 16:41
has joined #pact-broker

mwroblewski
2019-03-24 16:41
Hello, I have a question concerning plugging Pact into CI / CD: https://stackoverflow.com/questions/55324476/plugging-pact-into-ci-cd. Thanks for help in advance

bethskurrie
2019-03-24 22:17
Your command is wrong.

bethskurrie
2019-03-24 22:17
Please see the comment on the issue.

bethskurrie
2019-03-25 02:57
I've updated the can-i-deploy logic so that can-i-deploy does not stop you deploying a provider to a given environment when the consumer is not yet deployed.

bethskurrie
2019-03-25 02:58
I know there have been a few people having problems with this. Please update your broker and try again.

matt.fellows
2019-03-25 05:52
Is this the WIP pacts or just not failing if there are no consumers yet?

bethskurrie
2019-03-25 05:52
No, different issue

matt.fellows
2019-03-25 05:52
Oh

bethskurrie
2019-03-25 05:53
Sorry, yes, kind of the second point.

hossam.saraya.ext
2019-03-25 10:03
I haven't added anything since then as I am quite super busy. I don't know when I am getting more free time :disappointed:

bethskurrie
2019-03-25 10:04
I feel your pain. It's why the UI still looks like it does after 5 years!

hossam.saraya.ext
2019-03-25 10:05
:smile: yea...it's always the UI that we compromise at the end..sadly

bethskurrie
2019-03-25 10:05
It's the part I enjoy the least, so there are always other things I find higher on the priority list!

arunkumarpoonia
2019-03-25 11:10
Thanks @matt.fellows

matt.fellows
2019-03-25 11:36
:+1:

richard.jones
2019-03-25 22:39
I?ve finally found some time to poke into it more, and learn a bit more how to read the ruby code, and think I?ve found an issue: the code at https://github.com/pact-foundation/pact_broker/blob/master/lib/pact_broker/domain/verification.rb#L83 joins `verifications` and `pact_publications` on `pact_version_id` from both tables, but in our database we have 228 rows where there is no corresponding entry in `pact_publications` for the `pact_version_id` in `verifications`. This would result in a `nil` provider, if I understand correctly. Many different `pact_version_id` are in those 228 rows.

bethskurrie
2019-03-25 22:39
um

bethskurrie
2019-03-25 22:39
that data is wrong

richard.jones
2019-03-25 22:39
There hasn?t been a bogus row in `verifications` generated since December though

bethskurrie
2019-03-25 22:39
that should be impossible

richard.jones
2019-03-25 22:39
:smile:

bethskurrie
2019-03-25 22:40
are they old rows?

richard.jones
2019-03-25 22:40
`select * from verifications where pact_version_id not in (select pact_version_id from pact_publications);` is the SQL I used to find those rows

richard.jones
2019-03-25 22:40
dated from June to December last year

bethskurrie
2019-03-25 22:40
you haven't done a manual cleanup of the data at some stage have you?

richard.jones
2019-03-25 22:40
that?s not ?old? in our broker

richard.jones
2019-03-25 22:40
not that I?m aware of

richard.jones
2019-03-25 22:41
I will ask

bethskurrie
2019-03-25 22:41
ok *that* is an issue.

bethskurrie
2019-03-25 22:41
I will have a look at some other databases.

bethskurrie
2019-03-25 22:42
it's like the pact was verified, and then the publication was deleted through the API.

bethskurrie
2019-03-25 22:42
that would cause that scenario.

richard.jones
2019-03-25 22:43
OK, yep. We definitely need to do some weeding in our broker, as we know there?s a bunch of mis-registered pacts (mis-spelled or just out of date participants for a start). But we?ve not done any of that yet.

richard.jones
2019-03-25 23:24
I?ve confirmed with the broker maintainers here that we?ve only used the API calls to manipulate data in the broker, never manual SQL.

bethskurrie
2019-03-25 23:24
the API call that deletes a pact will leave your data in that situation.

bethskurrie
2019-03-25 23:24
it deletes the publication, but leaves the content, and its connected verifications.

bethskurrie
2019-03-25 23:24
I'm not sure what the best thing is to do about it. Will have to give it some thought.

bethskurrie
2019-03-25 23:25
basiscally, it seems you have left over verifications for pact publications that have been deleted at some stage.

bethskurrie
2019-03-25 23:26
to fix it, you could delete all those orphan verifications.

richard.jones
2019-03-26 00:18
(sorry for AFK) thanks for investigating! We can certainly delete the orphan rows, thanks.


arunkumarpoonia
2019-03-26 09:01
what is the best approach to manage provider state ?

mwroblewski
2019-03-26 09:51
Hello, is it possible to use pact broker without tags ? https://stackoverflow.com/questions/55346970/using-pact-broker-without-tags

matt.fellows
2019-03-26 09:53
I'll try to answer later, but the short answer is yes (you just get less flexibility)

matt.fellows
2019-03-26 09:53
The longer answer is... Why :laughing:

mwroblewski
2019-03-26 10:01
Thanks in advance, let's just say it's due to the way feature branches are used in our project - we can't use their name as tags :wink:

bethskurrie
2019-03-26 10:09
Can you sha the name of the branch to something short and unique?

bethskurrie
2019-03-26 10:10
Are the names too long?

bethskurrie
2019-03-26 10:10
Tag names can contain slashes (eg feat/foo) if that's what the issue is.

bethskurrie
2019-03-26 10:12
That is a very vague question @arunkumarpoonia. Can you be more specific?

bethskurrie
2019-03-26 10:14
I'm making a thread so we don't spam everyone.

bethskurrie
2019-03-26 10:14
You say in your question that the build could still pass even if the pact verification failed. Which build?

bethskurrie
2019-03-26 10:14
Why would it pass?

bethskurrie
2019-03-26 10:15
Can you be clearer about the underlying problem that is stopping you using tags? Is it a technical issue or a human one?

mwroblewski
2019-03-26 10:16
this is rather organizational issue

mwroblewski
2019-03-26 10:16
we use separate feature branches for single small issues in JIRA

bethskurrie
2019-03-26 10:18
I don't see a problem with that.

mwroblewski
2019-03-26 10:18
also there is a separate issue for provider / consumer developer team

bethskurrie
2019-03-26 10:20
If suggest trying to just get things going without tags

bethskurrie
2019-03-26 10:21
Personally, I think the main tags to have are dev and prod.

bethskurrie
2019-03-26 10:22
This is what allows you to ensure backwards compatibility between your consumer and provider.

bethskurrie
2019-03-26 10:22
Feature tags are icing on the cake.

bethskurrie
2019-03-26 10:22
Try with those two tags and see how you go.

mwroblewski
2019-03-26 10:22
ok, thanks

bethskurrie
2019-03-26 10:23
You tag with dev when you publish the pact, and tag with prod when you deploy that app version to prod.

bethskurrie
2019-03-26 10:24
This will allow you to run can-i-deploy - - pacticipant Foo - - to prod

bethskurrie
2019-03-26 10:24
Sorry, on phone, bad formatting.

matt.fellows
2019-03-26 10:39
FWIW I almost always start with just those two tags and in many situations that is good enough

matt.fellows
2019-03-26 10:40
Not all projects enable easy symmetry of feature branches, so that can be difficult.

bethskurrie
2019-03-26 10:44
This is an awesome resource @yousafn

mwroblewski
2019-03-26 11:05
thank you

matt.fellows
2019-03-26 11:11
:thumbsup:

adamgreen
2019-03-26 15:16
has joined #pact-broker

arunkumarpoonia
2019-03-27 08:22
what is the best approach to create provider state when we verify contract . I am using https://github.com/pact-foundation/pact-provider-verifier this to verify pact.

matt.fellows
2019-03-27 08:23
what options are you considering?+

matt.fellows
2019-03-27 08:24
Do you have to use that verifier? Is there not a language/framework you can use? (more optimal)

arunkumarpoonia
2019-03-27 09:36
@matt.fellows can you please suggest a framework for php ?

arunkumarpoonia
2019-03-27 09:37
what is the best approach to handle provider state ? it will be good to get some pointers so that we can head in right direction .


matt.fellows
2019-03-27 09:45
> what is the best approach to handle provider state ? it will be good to get some pointers so that we can head in right direction . Normally I use a state to setup a data fixture (e.g. to seed a specific set of data into a database)

arunkumarpoonia
2019-03-27 10:18
Thanks @matt.fellows i looked at pact-php but cant find any example to handle provider state?

arunkumarpoonia
2019-03-27 10:18
it will be really helpful if you can share any example .


matt.fellows
2019-03-27 10:22
Basically, you need to add a route to your code (just during testing). It will be called prior to each test, to ask the API to setup a particular state. That is where you can change the database / setup internal state etc.

matt.fellows
2019-03-27 10:22
Might want to ask in the #pact-php channel

arunkumarpoonia
2019-03-27 10:26
Thanks a lot @matt.fellows

matt.fellows
2019-03-27 10:27
np

adamgreen
2019-03-27 16:39
Hi all. Is it possible to configure CORs when using pact_broker-docker?


adamgreen
2019-03-27 16:40
however i am still getting Cross Origin errors when calling the APIs from an external web app

arunkumarpoonia
2019-03-28 11:50
How to verify a interaction when id is generated randomly?

arunkumarpoonia
2019-03-28 11:50
if i want to test getCustomer/{customerId} customer id is random here

arunkumarpoonia
2019-03-28 11:51
I am able to test post action but not sure how to create state for {ustomerId} here

arunkumarpoonia
2019-03-28 11:51
any help will be appreciated

dagarwal
2019-03-28 12:10
you need to pass the exact id .i achieved this by updating db at provider level

arunkumarpoonia
2019-03-28 13:19
ok, thanks

mboudreau
2019-03-28 22:18
Exact id if that's important for you to test, or you can use a matcher so that it doesn't matter what it is

mboudreau
2019-03-28 22:19
You can essentially wildcard it so it doesn't matter what's passed in

bethskurrie
2019-03-29 03:40
That can actually be quite tricky @arunkumarpoonia and the answer depends on which library (language) you're using. Can you ask the question in the relevant channel? eg #pact-jvm or #pact-js

bethskurrie
2019-03-29 03:41
@arunkumarpoonia are you talking about CORS issues with the mock service or the Pact Broker?

bethskurrie
2019-03-29 03:42
I feel like you may be getting them confused. The mock service runs on your local machine, and provides an HTTP mock provider. The Pact Broker allows you to exchange contracts and verification results between projects. I can't see why you'd have CORS issues making a request to the Pact Broker.

adamgreen
2019-03-29 08:34
@bethskurrie we're trying to access the pact-broker from a different web application through the apis but due to the different domains the the pact-broker doesn't allow cross domain requests

bethskurrie
2019-03-29 08:35
Is it your own instance, or the hosted version?

adamgreen
2019-03-29 08:37
we're running our own hosted version using the docker-compose set up

bethskurrie
2019-03-29 08:38
You'll need to set the appropriate cors headers in the nginx config

adamgreen
2019-03-29 08:39
ah ok, so we need the reverse proxy if we're going to do this then? That's fine, i'll have a look into setting that up. Thanks for the guidance :slightly_smiling_face:

bethskurrie
2019-03-29 08:40
Pretty sure the docker compose has an nginx set up.

adamgreen
2019-03-29 08:42
when setting up for the first time in an azure vm, passenger phusion was having trouble with the nginx set up, if i recall correctly. removing the nginx removed that issue, hence maybe i've ended up looking in the wrong place for a solution

bethskurrie
2019-03-29 08:44
You can always add them in rack middleware quite easily.


adamgreen
2019-03-29 08:50
so if i pull the pact-broker repo, add that to the app.rb file, build my own broker image - we should be good to go. I'll give this a shot. Thanks again!

bethskurrie
2019-03-29 08:52
Yes, clone the docker repo. Add the rack cors gem to the gem file.

bethskurrie
2019-03-29 08:53
Then add the "use" statement in the http://config.ru

arunkumarpoonia
2019-03-29 15:59
thanks @bethskurrie for your reply. I am using pact-php

yousafn
2019-03-29 17:11
Ola, does the webhook event `contract_content_changed` fire if there is a different version number? Our pact version numbers use circleci buld num + git commit sha such as `761-45dd0a4`. and we tag with `feature/foo-123` If I trigger the CI build to run again, the version number will be upped due to the circleci build number increasing from `761-45dd0a4` to `762-45dd0a4`. The content of the pact hasn?t changed, bar the version number, and this fires the ` "name": "contract_content_changed"` event.

yousafn
2019-03-29 17:12
Danke in advance

bethskurrie
2019-04-01 02:29
No. The event only fires if the content has changed.

bethskurrie
2019-04-01 02:30
Hence the name "contract_content_changed".

bethskurrie
2019-04-01 02:30
:wink:

bethskurrie
2019-04-01 02:30
There must be some non deterministic data in your contract.

bethskurrie
2019-04-01 02:32
To work out what this is, open the pact in the API (HAL) browser, then use either the `pb:diff` or `pb:diff-previous-distinct` relations to work out what has changed in the contract.

bethskurrie
2019-04-01 02:33
@yousafn using CI build numbers is not recommended. Have a read of this: https://github.com/pact-foundation/pact_broker/wiki/Pacticipant-version-numbers

franklin.huynh
2019-04-01 03:19
has joined #pact-broker

franklin.huynh
2019-04-01 03:31
Hi, I'm not sure if it is the right place to ask. I'm having an issue with triggering webhook to bamboo build. I receive this error. ``` "error": { "message": "SSL_connect returned=1 errno=0 state=error: certificate verify failed", ``` I can make sure the request and webhook created correctly. Could anyone shed a light for me? I could provide more stacktrace if needed

bethskurrie
2019-04-01 03:31
yes. your bamboo instance probably has a self signed certificate.


franklin.huynh
2019-04-01 03:34
thanks @bethskurrie for your quick response. I tried implementing that and the fix by executing this script https://github.com/pact-foundation/pact_broker/blob/master/script/insert-self-signed-certificate-from-url.rb I don't have much knowledge on ruby I'm having issue with the database credentials

bethskurrie
2019-04-01 03:34
what sort of database do you have?

franklin.huynh
2019-04-01 03:36
postgres does that answer your question?

bethskurrie
2019-04-01 03:36
yes

bethskurrie
2019-04-01 03:36
DATABASE_CREDENTIALS = {logger: Logger.new($stdout), adapter: "postgres", host: "HOST", username: "USERNAME", password: "PASSWORD", :encoding => 'utf8'}

bethskurrie
2019-04-01 03:36
you'll need to provider the creds and host

franklin.huynh
2019-04-01 03:36
I'll try this now

franklin.huynh
2019-04-01 03:36
thanks Beth

bethskurrie
2019-04-01 03:37
you'll need to comment out line 10 as well.

franklin.huynh
2019-04-01 03:39
sure thanks

franklin.huynh
2019-04-01 04:02
Hi @bethskurrie I tried and get this error ``` /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': LoadError: cannot load such file -- pg (Sequel::AdapterNotFound) from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /Library/Ruby/Gems/2.3.0/gems/sequel-5.18.0/lib/sequel/adapters/postgres.rb:6:in `<top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /Library/Ruby/Gems/2.3.0/gems/sequel-5.18.0/lib/sequel/database/connecting.rb:88:in `load_adapter' from /Library/Ruby/Gems/2.3.0/gems/sequel-5.18.0/lib/sequel/database/connecting.rb:17:in `adapter_class' from /Library/Ruby/Gems/2.3.0/gems/sequel-5.18.0/lib/sequel/database/connecting.rb:45:in `connect' from /Library/Ruby/Gems/2.3.0/gems/sequel-5.18.0/lib/sequel/core.rb:121:in `connect' from certificate2.rb:20:in `<main>' ```

franklin.huynh
2019-04-01 04:02
I couldn't execute the script

bethskurrie
2019-04-01 04:03
how are you executing it?

bethskurrie
2019-04-01 04:03
you need the pg gem available

bethskurrie
2019-04-01 04:03
what languages are you familiar with?

franklin.huynh
2019-04-01 04:03
C# java

franklin.huynh
2019-04-01 04:04
and shell script

bethskurrie
2019-04-01 04:04
ok, so it's like executing a java file without you pom.xml

bethskurrie
2019-04-01 04:04
it doesn't know where to get your dependency from.

bethskurrie
2019-04-01 04:04
where are you executing the script from?

franklin.huynh
2019-04-01 04:05
I'm executing in my local machine

bethskurrie
2019-04-01 04:05
have you got the pact_broker project checked out?

franklin.huynh
2019-04-01 04:05
I host the pact broker docker on my local

bethskurrie
2019-04-01 04:05
ok, run `bundle install`

franklin.huynh
2019-04-01 04:05
I used the docker-compose up to host it on my local

bethskurrie
2019-04-01 04:06
I need to just write an API for this.

bethskurrie
2019-04-01 04:06
Sorry.

franklin.huynh
2019-04-01 04:07
that's ok, you're doing great.

franklin.huynh
2019-04-01 04:08
I'm QA not DevOps or Dev so it's taking me so long to figure this out

bethskurrie
2019-04-01 04:08
are you comfortable with sql?

franklin.huynh
2019-04-01 04:09
no I'm not let me try with the bundle install and run the script again

bethskurrie
2019-04-01 04:11
``` require 'uri' require 'securerandom' require 'date' require 'json' uri_string = "https://google.com" uri = URI(uri_string) certificate_command = "openssl s_client -showcerts -servername #{uri.host} -connect #{uri.host}:#{uri.port} </dev/null 2>/dev/null | openssl x509 -outform PEM" certificate_content = `#{certificate_command}` puts "Downloaded certificate from #{uri.host}: #{certificate_content}" puts({ uuid: SecureRandom.urlsafe_base64, description: "Self signed certificate for #{uri.host}", content: certificate_content, created_at: DateTime.now, updated_at: DateTime.now }.to_json) ```

bethskurrie
2019-04-01 04:11
ok, that script will give you the fields you need to insert

bethskurrie
2019-04-01 04:12
install pgAdmin and then just manually insert the record into the database.

franklin.huynh
2019-04-01 04:14
ok

franklin.huynh
2019-04-01 04:36
@bethskurrie Guess what, itis working like a charm after I inserted the certificate manually. I just wanna say thank you so much for your support

franklin.huynh
2019-04-01 04:39
I have a question. do we have a pact broker cloud version with licensed?

bethskurrie
2019-04-01 04:39
np

bethskurrie
2019-04-01 04:39
with licenced what?

bethskurrie
2019-04-01 04:40
If you are interested in a cloud version, go to http://pact.dius.com.au and sign up for a free trial.

bethskurrie
2019-04-01 04:41
(I work on this along with @matt.fellows and @uglyog)

franklin.huynh
2019-04-01 04:49
I registered it before. But chose to host by our company. (on aws) However, I found out that it may requires effort to maintain it sometime and also cost us a bit on aws service. so we may consider if we can go with licensed cloud version

matt.fellows
2019-04-01 05:50
If by licensed you mean paid/supported, please drop us an email at and we can chat further

franklin.huynh
2019-04-01 05:54
yes @matt.fellows , that's what I mean. Will drop an email asap

matt.fellows
2019-04-01 07:08
:+1:

yousafn
2019-04-01 12:46
Thanks for the reply Beth. Looking at the `pb:diff` or `pb:diff-previous-distinct` relations really helped. It looked to be verifying against old pacts, that actually had changes in, and was ignoring the tag. This appeared to be due to the way we were publishing/tagging - we used 2 curl scripts, one to publish, one to tag. We have now switched to the pact-js publishing step, and tag during the publish step, which has tightened up the checks against contracts using the same tag only, limiting the webhook noise we were getting With regards to the CI number, we use the build number from our deploy step to tag our artefacts, which we promote from test, into staging and production, so the source is always known. Apparently we store this in a git tag, so I will use that, plus a git sha to make up the version number

qatrera
2019-04-02 13:57
has joined #pact-broker

bethskurrie
2019-04-03 06:08
Cool. Sounds like you have it covered.

bethskurrie
2019-04-03 06:09
Yes, you have to tag before you publish.

adamgreen
2019-04-03 14:26
Hi Beth, sadly had no joy in just amending the config as part of the pact_broker-docker repo, suspect i'd have to amend the app.rb file in the base pact-broker repo and create my image from there?

bheemreddy181
2019-04-05 20:14
has joined #pact-broker

jon.pascoe
2019-04-09 11:17
has joined #pact-broker

florian
2019-04-09 20:40
has joined #pact-broker

vitaliy.grigoruk
2019-04-11 15:20
Hi there. I?m trying to add a webhook to pact broker, which will trigger provider verification on provider CI. But for this, I need somehow to tell provider exactly which consumer contract has changed (I don?t want to re-run provider verification for all tags / versions of all consumers). I?d like to run verification only a contract that has been just published. Is there any way to add variables to webhook definitions? e.g. I?d like to pass consumer `$contractTags` to provider CI.

vitaliy.grigoruk
2019-04-11 19:12
pls ignore, already found this in docs :slightly_smiling_face:

franklin.huynh
2019-04-12 00:04
Hi @vitaliy.grigoruk , I have a question but not sure if it is the same with you or not. I'd like the webhook trigger only when the contract with "master" tag changed. Are we able to do it? I cannot find it is the docs.

bethskurrie
2019-04-12 01:22
Hi @vitaliy.grigoruk @franklin.huynh this feature is on the backlog. In the meantime, you can add the consumerVersionTags to the webhook body (as per https://github.com/pact-foundation/pact_broker/blob/master/lib/pact_broker/doc/views/webhooks.markdown#dynamic-variable-substitution) and get it to trigger an intermediate build. That intermediate build can decide whether or not to trigger the downstream build, and what branch of the provider to use.

matt.fellows
2019-04-12 01:26
Hi , this morning we enabled a Web Application Firewall on our hosted Pact Broker service (https://pact.dius.com.au). This follows a number of additions to our security, compliance and auditing work this year, including a recent third party penetration test. We are monitoring the change closely, however if you do experience any issues today that are out of the ordinary, please let us know so that we can investigate ASAP. Cheers, Matt

james.carman
2019-04-12 01:27
We did see some 504s today. I was wondering if you guys were doing some maintenance

matt.fellows
2019-04-12 01:27
I?ll DM you so we can work through it

bethskurrie
2019-04-12 01:28
@james.carman we've put out a new version of the pact-jvm library with retries to handle any 504s that happen during broker interactions. If you're using one of the other languages, let me know so I can make sure it's got the latest code.

franklin.huynh
2019-04-12 01:29
good solution in the meantime :thumbsup:

james.carman
2019-04-12 01:29
What version of pact-jvm do I need? Just get what?s in central now?

bethskurrie
2019-04-12 01:29
latest in central

james.carman
2019-04-12 01:30
I?m on it. Thanks

james.carman
2019-04-12 01:31
Gotta get kids in bed first. Then I?ll upgrade and get a build going

bethskurrie
2019-04-12 01:31
^^ story of my life

matt.fellows
2019-04-12 01:34
Confirmed that the 504s are unrelated to the change (I think the JVM issues as you mentioned)

james.carman
2019-04-12 01:42
Would you guys be interested in a nice ?test harness? for JAX-RS-based services?

matt.fellows
2019-04-12 01:42
like, a Pact specific one?

james.carman
2019-04-12 01:42
Yeah

james.carman
2019-04-12 01:42
for doing pact verifications

james.carman
2019-04-12 01:43
I?m going to publish one in my ?Jaxxy? library and I?ll let you know when it?s out there: https://github.com/jaxxy-rs/jaxxy

matt.fellows
2019-04-12 01:43
I?m keen to see it, @uglyog would probably have more opinions as the JVM mantainer

matt.fellows
2019-04-12 01:44
Ha, Jasmine the retreiver

james.carman
2019-04-12 01:44
She?s a big sweetie!

bethskurrie
2019-04-12 01:44
A friend for Mary the Alligator?

james.carman
2019-04-12 01:46
So, this 3.6.3 version of pact-jvm does the retries automatically? Or, do I need to turn on some setting?

matt.fellows
2019-04-12 01:46
should be automatically, I believe

james.carman
2019-04-12 01:46
cool, thanks

vitaliy.grigoruk
2019-04-12 07:26
I guess it is not possible. But you can pass tags to your CI job and then based on tag value either perform a build or not. Alternatively, you can have a small proxy application running between pact broker and your CI, where you can do filtering of webhooks based on tag value

vitaliy.grigoruk
2019-04-12 09:40
Hey folks, what are the best practices around cleanup of consumer versions that are not needed anymore (e.g. the ones that are already released). For example, when `consumer feature branch is deleted` -> remove all consumer contract versions that were associated with that deleted branch.

bethskurrie
2019-04-12 09:41
You can delete by tag.

bethskurrie
2019-04-12 09:42
Have a look at the Pact Broker github wiki, on the "deleting things" page.

vitaliy.grigoruk
2019-04-12 09:42
:+1:

vitaliy.grigoruk
2019-04-12 09:42
thank you, @bethskurrie

kevin.meiresonne
2019-04-15 09:46
Hi all, we have this weird issue on our hosted pact broker. When publishing a new version of a certain contract, we keep getting a 403 FORBIDDEN since April 12th. However, publishing other contracts on the same broker using the same credentials works just fine... Any idea what could be causing this?

bethskurrie
2019-04-15 09:47
I may be in the process of fixing that as we speak.

bethskurrie
2019-04-15 09:48
i'll ping you when I've finished deploying, and we can see if it fixes it.

bethskurrie
2019-04-15 09:48
is there a dot in the consumer version number?

kevin.meiresonne
2019-04-15 09:48
Great, that would be excellent

kevin.meiresonne
2019-04-15 09:48
no dots, we use commit sha as version number

bethskurrie
2019-04-15 09:49
hm. maybe this won't fix it. but let's see.


bethskurrie
2019-04-15 09:50
There is some routing logic that makes sure the request goes to the right place (UI or API) based on the headers, content types, etc. I realised this afternoon that there was a bug in it.

bethskurrie
2019-04-15 09:51
I love everything about our new build pipeline, except that it takes what I consider ages to deploy to prod because of ECS draining. Will ping you in half an hour or so...

kevin.meiresonne
2019-04-15 09:52
Weird though that we only have this issue on one particular contract... All others work just fine, just this one started giving 403's since friday

bethskurrie
2019-04-15 09:52
let me have a look at the logs

vinod.baradwaj
2019-04-15 10:57
webhooks in our broker is not triggering provider jobs in jenkins. When i try to directly call pb:execute endpoint, it is triggering the job in jenkins. But the same is not getting triggered when pact file is updated to broker. Is this something related to versioning of the pact files ?

bethskurrie
2019-04-15 11:15
Has the content changed?

bethskurrie
2019-04-15 11:16
Webhooks are only triggered when the content itself has changed, not just when a new publication is made.

vinod.baradwaj
2019-04-15 11:16
then what about the version ? if we update the version ?

bethskurrie
2019-04-15 11:17
No

bethskurrie
2019-04-15 11:17
There's no point - if the previous version is verified, and it's the same content, then it gets the same verification results.


bethskurrie
2019-04-15 11:20
If the content is the same as the previous version, then the only reason you'd need to run the verification again is if the provider had changed - but then if the provider had changed, it would run it's own build, and would pull in the latest pacts and verify them during that.

vinod.baradwaj
2019-04-15 11:38
ah okay got it... thanks Beth :slightly_smiling_face:

bethskurrie
2019-04-15 11:42
:+1:

arunkumarpoonia
2019-04-15 12:22
@vinod.baradwaj @beth I am unable to trigger webhook, getting below error :

arunkumarpoonia
2019-04-15 12:22
{ "errors": { "request.url": [ "scheme must be https. See /doc/webhooks#whitelist for more information." ] } }

beth
2019-04-15 12:23
has joined #pact-broker

arunkumarpoonia
2019-04-15 12:28
Unable to add webhook for non secure URL

arunkumarpoonia
2019-04-15 12:29
{ "errors": { "request.url": [ "scheme must be https. See /doc/webhooks#whitelist for more information." ] } }

bethskurrie
2019-04-15 21:18
Well. What did the docs say @arunkumarpoonia?

bethskurrie
2019-04-15 21:18
Did you find the part where it tells you how to configure the whitelist?

matt.fellows
2019-04-15 22:08
Do you have a question?

ian.mcwilliams
2019-04-16 14:49
has joined #pact-broker

marc
2019-04-17 13:28
has joined #pact-broker

iruben91
2019-04-17 14:17
has joined #pact-broker

arunkumarpoonia
2019-04-18 15:12
I want to create webhook for gitlab, it will be if someone can provide me sample request.


ravbaker
2019-04-19 13:15
@bethskurrie hi! I?ve just made a PR that fixes merging of pacts when they have the v2/v3 way of naming `providerState` https://github.com/pact-foundation/pact_broker/pull/269 Please review and incorporate in next release if no objections. We have been using this as a fix in forked version of pact_broker for some time without any issues in my current project. I?m also open for discussion if something is unclear.

vaso.giamarelou
2019-04-20 11:43
has joined #pact-broker

bheemreddy181
2019-04-22 01:38
Is it recommended to trigger the Travis CI or CIRCLE CI job of provider when we write webhooks from Consumer Side or Create a specific job on Jenkins which just does pact:verify , rather if we trigger Travis CI Job it might trigger the functional tests and unit tests etc as well @bethskurrie @matt.fellows ?

bheemreddy181
2019-04-22 01:39
The wait time from Travis CI job might be more compared to the time taken by the jenkins job which just does pact:verify ?

bethskurrie
2019-04-22 01:39
Personally, I'd just make a separate job that did the pact:verify, so as to get quicker feedback.

bethskurrie
2019-04-22 01:40
But of course, you'd want the pact:verify to also run during the normal build of the provider too.

bethskurrie
2019-04-22 01:40
Remember, if the pact hasn't changed, it's "pre-verified" in the broker, and no webhook gets triggered.

matt.fellows
2019-04-22 01:43
I don't really like triggering the provider builds from a consumer publish, and tend not to need it. Occasionally you push a change on the consider that requires waiting for a provider build and we just handle it by talking to the teams. This problem will be improved with the upcoming WIP pacts feature also

matt.fellows
2019-04-22 01:43
Simpler is better here IMO

bheemreddy181
2019-04-22 01:44
Makes sense :slightly_smiling_face:

bheemreddy181
2019-04-22 01:48
@bethskurrie Does *last published pact* change each time I publish a new pact but it is the same as the previous pact - I don't see a change in there until unless I change the expectations - if the expectations are not changed then it shows way older value?

matt.fellows
2019-04-22 02:21
That sounds correct - there is no _new_ published pact, just the same one published again

matt.fellows
2019-04-22 02:22
so no, the *last published pact* doesn?t change if you keep pushing the same contract up

bethskurrie
2019-04-22 02:28
It probably uses the date of the content, rather than the publication.

bheemreddy181
2019-04-22 02:40
but doesn't we have to update the latest date there so that we will know that the pact published but don't trigger the webhooks because the content didn?t change ?

bethskurrie
2019-04-22 02:49
If you're in doubt about anything, look at the matrix page

bethskurrie
2019-04-22 02:49
It has every pact publication and verification.

bheemreddy181
2019-04-22 02:51
you mean matrix shows the latest date ?

bethskurrie
2019-04-22 02:51
The top row

bethskurrie
2019-04-22 02:52
Will have the date that the most recent pact was published

bheemreddy181
2019-04-22 03:06
@bethskurrie It doesn?t actually i published two pacts within a time difference of 2 mins, I only see one which was published 2 mins ago

bheemreddy181
2019-04-22 04:07
I published 10 pacts in last one hour -- i only see one which is published one hour ago

bethskurrie
2019-04-22 04:46
Did they have the same consumer version number?

bethskurrie
2019-04-22 04:47
What is the output from the publishing logs? You can turn on verbose output.

bethskurrie
2019-04-22 05:02
So, if you publish with the exact same consumer version number and the same content, no new resource gets created.

bethskurrie
2019-04-22 05:04
If you publish a pact with the same content, but a different consumer version number, you'll see a new line in the matrix, but no webhooks will be triggered. If you publish content that has changed, and a new consumer version number, you'll see a new line in be matrix, and the webhooks will be triggered.

bheemreddy181
2019-04-22 12:56
They have the same consumer version and same content

bheemreddy181
2019-04-22 14:24
I agree that no new resource would get created but why not the *last published pact* value doesn't change ?

bheemreddy181
2019-04-22 14:55
@bethskurrie ^

bethskurrie
2019-04-22 20:09
It was an arbitrary decision that could have gone either way. The underlying pact publication database row is designed to be immutable, and so only has a created date, not an updated date.

bethskurrie
2019-04-22 20:10
I could add an updated date column, and set it if an identical request came in.

bethskurrie
2019-04-22 20:11
Nobody has actually raised it before. I think it's probably only relevant when you're messing around. Usually, the consumer version number will change with each build and that means the last published date should change. I'll double check which column it's using @bheemreddy181

bheemreddy181
2019-04-22 21:04
Sure thanks, Beth.

alexei
2019-04-23 10:27
has joined #pact-broker

vitaliy.grigoruk
2019-04-24 12:21
Hi folks. I have couple of pact publishing failures today. ``` [2019-04-24T10:30:36.020Z] ERROR: pact-node@6.21.5/112 on 7758fa148fa7: Could not publish pact: Failed to publish consumer/provider pact due to error: PactBroker::Client::Error - <html> <head><title>502 Bad Gateway</title></head> <body bgcolor="white"> <center><h1>502 Bad Gateway</h1></center> </body> </html> ``` Wondering if anybody else seeing the same.

vitaliy.grigoruk
2019-04-24 13:03
I?d also like to talk about future pricing of https://pact.dius.com.au/ Who would be the best contact person?

matt.fellows
2019-04-24 22:25
Hi @vitaliy.grigoruk, I'll dm you

matt.fellows
2019-04-24 22:26
We did see a few issues last night that resolved fairly quickly, let us know if you do have any further issues

bethskurrie
2019-04-24 22:49
@bheemreddy181 how are you going?

bheemreddy181
2019-04-24 22:51
Thanks for checking back , I haven?t got time to check the things what you mentioned last time I am yet to complete the POC ( working one ) for demo at our company

bethskurrie
2019-04-24 22:52
cool. let us know how you go!

bheemreddy181
2019-04-24 22:55
Sure

bheemreddy181
2019-04-24 22:55
The documentation you mentioned last time is not clear enough to understand for verifying pact from pact broker

bheemreddy181
2019-04-24 22:56
The version stuff and all

bheemreddy181
2019-04-24 22:56
I might need some more inputs

bheemreddy181
2019-04-24 22:56
Will let you know

bethskurrie
2019-04-24 22:56
You don't give it a version - you tell it to verify the latest version.

bethskurrie
2019-04-24 22:56
The broker knows which the latest version is.

bethskurrie
2019-04-24 22:56
(the one that was most recently published)

bheemreddy181
2019-04-24 22:57
I have quick question here - how do I check the optional field types while contract testing

bheemreddy181
2019-04-24 22:57
What if my provider has changed the optional type from string to int

bethskurrie
2019-04-24 22:57
that's the point - you find out the breaking changes in the test.

bheemreddy181
2019-04-24 22:57
I am trying fix this into a real use case

bethskurrie
2019-04-24 22:57
the point is not to stop the tests ever failing - the point is to have them fail up front.

bethskurrie
2019-04-24 22:57
your tests are the canary.

bethskurrie
2019-04-24 22:58
you find out *before* you deploy.

bethskurrie
2019-04-24 22:58
they can and should fail at some point.

bheemreddy181
2019-04-24 22:58
Yes true that I should write test for pieces what I send rather than writing for everything you mean ?

bheemreddy181
2019-04-24 22:59
Rather before deploy before even merge to master

bheemreddy181
2019-04-24 22:59
I want the feedback on my PR itself

bethskurrie
2019-04-24 22:59
the pact tests should run just after your unit tests.

bethskurrie
2019-04-24 22:59
yes, they should run before you merge the PR.

bheemreddy181
2019-04-24 23:00
Agree

bethskurrie
2019-04-24 23:00
They should run before you ever deploy.

bheemreddy181
2019-04-24 23:00
One more thing if have my own verification task I set to the latest rather than version as you said

bethskurrie
2019-04-24 23:01
If you have integration tests that require you to deploy to a test environment, they should definitely be run before then. They should fail if something has changed, so that you don't even deploy a broken integration.

bethskurrie
2019-04-24 23:01
quick feedback.

bheemreddy181
2019-04-24 23:01
In that case my pact_helper will not have the pact_uri ?

bethskurrie
2019-04-24 23:01
you should give it the broker details

bethskurrie
2019-04-24 23:01
it will work out what pacts to pull in based on the provider name.

bethskurrie
2019-04-24 23:02
best practice is to manage your versions with tags - let me find you some links.



bheemreddy181
2019-04-24 23:04
What do you mean by tags ?

bethskurrie
2019-04-24 23:04
Please read the docs!

bheemreddy181
2019-04-24 23:04
My versioning would be a commit hash

bheemreddy181
2019-04-24 23:04
Sure will take a look

bethskurrie
2019-04-24 23:04
If you haven't come across tags by now, you're missing a critical part, and there's more reading to do.

bethskurrie
2019-04-24 23:04
Please do read those two links I pasted above.

bheemreddy181
2019-04-24 23:04
Oh I see makes sense

bheemreddy181
2019-04-25 03:54
Out of the below 4 links apart from docker pact broker everything else is returning 404 just fyi


bethskurrie
2019-04-25 04:14
yeah, that link is broken

bethskurrie
2019-04-25 04:14
send me the parent link and i'll fix it.

bethskurrie
2019-04-25 04:16
ok, found it

bethskurrie
2019-04-25 04:19
they should be updated in the gitbook soon

yousafn
2019-04-26 09:36
Hey all, Been messing about with AWS Lambda recently, and have managed to get the pact-broker running in a lambda function. I have a repo here https://github.com/YOU54F/pact_broker-serverless The lambda based pact broker can be visited on https://you54f.co.uk/ I will be doing a blog write up in the next week, but for now, enjoy :ok_hand:

bethskurrie
2019-04-26 09:41
Ha! @matt.fellows has been trying to talk me into this for ages.

bethskurrie
2019-04-26 09:41
My concern was slow load times. How have you found it?

yousafn
2019-04-26 09:45
It?s pretty decent tbh, so much quicker than heroku that?s for sure. (mind you, my heroku instance is running passenger standalone) I need to hook it up with a CI pipeline later on today on one of my pact example repos so I can push pacts, perform webhooks and verifications and make sure everything is working as intended

matt.fellows
2019-04-26 09:47
Background processes won't work, and some other things won't will need to change but that's great!

bethskurrie
2019-04-26 09:48
Hm. The webooks are executed in an async way.

yousafn
2019-04-26 09:48
This is load times on pact-broker hosted on an ECS instance for info

bethskurrie
2019-04-26 09:48
You may hit difficulties with that.

bethskurrie
2019-04-26 09:50
Nice load times.

yousafn
2019-04-26 09:50
I imagine it is going to be a painful process, especially as it wasn?t designed to run in a lambda, but I?m not planning on running this in prod for work, it was more for my experimentation with AWS lambda, and being able to understand it?s limitations. Will keep you lot posted anyhoo

yousafn
2019-04-26 12:01
publishing, slack webhooks (contract_content_changed & provider_verification_published) and verification seem to working a-ok! :party_parrot:

thadir
2019-04-26 15:11
Is there any good documentation on creating custom webhooks. I want to when the broker sees that the consumer changed the contract that the broker triggers our build server.Any one experiance with this?


kgrabowski
2019-04-27 09:04
has joined #pact-broker

bethskurrie
2019-04-28 02:35
we're doing some upgrades to the DiUS hosted broker folks. There will be some downtime on this one, but we should be back up and running within an hour. You can follow the status on http://status.pact.dius.com.au/

ashish.dubey91
2019-04-28 05:22
curious how?s the infrastructure fairing now overall? I remember there were issues few months ago which led us to setup our own broker

bethskurrie
2019-04-28 05:22
We should have a no downtime deployments env now.

bethskurrie
2019-04-28 05:23
We've had a massive improvement in reliability

bethskurrie
2019-04-28 05:24
We rearchitected the whole platform.

bethskurrie
2019-04-28 05:25
Today's deployment was some fine tuning of our resources.

matt.fellows
2019-04-28 07:50
++ security

bethskurrie
2019-04-28 08:04
We've WAFed it up recently.

matt.fellows
2019-04-28 08:20
There was a little patch right before Xmas that was rough

matt.fellows
2019-04-28 08:20
But since the new stack switch it's been great

matt.fellows
2019-04-28 08:20
Woukd you consider moving?

kevin.meiresonne
2019-04-29 12:35
Hi, we're getting slow responses and 502's on the hosted pact broker. Is there maintenance going on? Status page doesn't say so.

matt.fellows
2019-04-29 12:37
No, that is news to me

matt.fellows
2019-04-29 12:37
I?ll check dashboards, but no alarms have gone off

kevin.meiresonne
2019-04-29 12:42
Seems to be working again now

kevin.meiresonne
2019-04-29 12:42
maybe a glitch

matt.fellows
2019-04-29 12:44
I?ll be around for a few hours prepping for the AWS Summit, so ping me if you have issues

matt.fellows
2019-04-29 12:44
I?m not seeing any 502s in our logs, strangely

kevin.meiresonne
2019-04-29 12:45
hmm

matt.fellows
2019-04-29 12:45
That could be Humio delaying ingest or something

matt.fellows
2019-04-29 12:46
hmm no Humio seems up to date

kevin.meiresonne
2019-04-29 12:46
non technical question: does dius/pact have official logo's that can be used? I'm working on a slack webhook, and was wondering if I could use a proper pact logo for it


matt.fellows
2019-04-29 12:47
Not DiUS but official Pact ones

kevin.meiresonne
2019-04-29 12:47
excellent!

matt.fellows
2019-04-29 12:48
I?ll keep an eye on the broker

matt.fellows
2019-04-29 12:52
It looks like there might have been a garbage collection like event on RDS around that time. Average requests went up to 1.9s (around 10:30 local time, so 22 mins ago)

kevin.meiresonne
2019-04-29 13:19
Just got another 502

kevin.meiresonne
2019-04-29 13:19
after a refresh it was gone

matt.fellows
2019-04-29 13:20
I just got a notice of the same, investigating

matt.fellows
2019-04-29 13:20
nothing obvious causing it (CPU/mem/load etc.), so keen to see why

s1apped
2019-04-29 13:27
has joined #pact-broker

s1apped
2019-04-29 13:46
if I have a webhook with event = contract_content_changed, both consumer and provied version is commit sha and consumer is tagged with branch name

s1apped
2019-04-29 13:47
should this webhook trigger provider build even though the contract didn't change?

matt.fellows
2019-04-29 13:49
I don?t believe so, no


s1apped
2019-04-29 13:58
I double checked everything and don't see where I could make a mistake

matt.fellows
2019-04-29 14:01
thanks Matthew, we?ll get it looked at in due course

s1apped
2019-04-29 14:03
thank you

matt.fellows
2019-04-29 14:14
you?re welcome

vinod.baradwaj
2019-04-30 06:23
through pack-broker API's can we get list of providers for one particular consumer ?

bethskurrie
2019-04-30 06:26
you can if you don't mind filtering the output

bethskurrie
2019-04-30 06:27
If you use the "/pacts/latest" URL, you can match by consumer name

vinod.baradwaj
2019-04-30 06:30
thanks Beth.. :+1:

bheemreddy181
2019-05-01 03:52
So @bethskurrie I did read through tags part now I am clear on that - but we are not yet in place of implementing a feature branch but we merge everything into master as a dark release

james.carman
2019-05-01 19:11
is there a ?global? badge for a provider that means ?all pacts verified??

james.carman
2019-05-01 19:11
I see one for the consumer/provider pair

james.carman
2019-05-01 19:11
Or, is the idea that you?d put a badge for each provider you consume from on your consumer README?

vitaliy.grigoruk
2019-05-01 19:45
Hey folks, I have a question for people who?re using broker webhooks to trigger provider verifications when consumer contract is changed. How do you make your provider verification CI job to verify only changed contract ? Right now, my provider verification job verifies contracts from all consumers that have same tag. For example: - there is 1 provider and 3 consumers. - git branch name is used to tag contracts. - consumer#1 contract changes for master build and it is published to a broker. - broker webhook triggers provider verification CI job and passes `CONSUMER_VERSION_TAG=master` as build param - `pact-provider-verifier` is invoked with `--consumer-version-tag master` arg. As a result, provider verification CI job will fetch contracts from all 3 consumers instead of a contract that has been changed recently. It feels like `pact-provider-verifier` is missing an optional arg `--consumer`, so it will be possible to filter contracts by consumer name (if provided)

bethskurrie
2019-05-01 23:12
The webhook payload can be templated. You can pass the url of the contract that has just been published to the ci job, and if you can parse the parameters, you can then pass that url to the verification job.

bethskurrie
2019-05-01 23:13
It will be a different command than the one you use as part of your default verification job, where you would just give the name of the provider and it would fetch all the pacts based on the name. You'll need to use the format where you pass in a specific URL.

vitaliy.grigoruk
2019-05-02 05:34
how do I pass pact broker credentials in this case?

bethskurrie
2019-05-02 05:35
same args

bethskurrie
2019-05-02 05:35
just don't give it the provider name

bethskurrie
2019-05-02 05:35
pact-provider-verifier http://the-pact-that-changed --broker-username ... --broker-password ...

vitaliy.grigoruk
2019-05-02 05:36
great, thanks! I?ll try that

vitaliy.grigoruk
2019-05-02 05:36
worse documenting somewhere :slightly_smiling_face:

bethskurrie
2019-05-02 05:36
yes, when I answered your question I realised it wasn't written anywhere.

bethskurrie
2019-05-02 05:36
what docs have you been reading to set up the webhooks?

bethskurrie
2019-05-02 05:36
just trying to think where to put it.

bethskurrie
2019-05-02 05:37
I mean, the CLI args are documened in the github auth, and if you use --help

bethskurrie
2019-05-02 05:37
but this particular usage is not explained.


bethskurrie
2019-05-02 07:15
The problem is, there are so many different pact languages that someone might verify in, it's hard to know what docs to put where.

bethskurrie
2019-05-02 07:15
@uglyog in the pact-jvm impl, is it possible to set up a pact verification task (separate from the default one) that just accepts one pact URL and broker creds?

uglyog
2019-05-02 07:18
Yes, should work with Gradle or Maven

bethskurrie
2019-05-02 07:19
cool. I'll add some docs saying that you can configure your job to just accept the changed pact, and say "see the docs for your verification task" because we don't want to have that repeated all over the place.

bethskurrie
2019-05-02 07:34
I've updated this @vitaliy.grigoruk. Does that explain it clearly enough? https://github.com/pact-foundation/pact_broker/wiki/Webhooks#provider-ci

vitaliy.grigoruk
2019-05-02 07:57
looks great, thanks

bart.schotten
2019-05-02 10:47
has joined #pact-broker

bart.schotten
2019-05-02 10:54
Question: When you have a pacticipant A that is both a consumer of events of pacticipant B, *and* a consumer of an API of pacticipant B, it seems that you would have two contracts between the same consumer and provider (at least based on how it's now being implemented for pact-net. Is there a way for the Pact Broker to deal with this, or can it only deal with one contract per consumer-provider pair? A possible workaround would be to give the consumer or provider a slightly different name or something, but that's a bit nasty.

bethskurrie
2019-05-02 11:00
Sorry, there's no way apart from a separate name at the moment.

ian.mcwilliams
2019-05-02 11:01
i'll be hitting this issue in the near future - so pactSetup.js lets you set the provider info and it seems you can only set one consumer and provider, right? what if you are consuming from more than one provider?

ian.mcwilliams
2019-05-02 11:01
```global.provider = new Pact({ consumer: 'my-system', provider: 'some-provider', port: global.port, log: path.resolve(__dirname, '../', 'logs', 'mockserver-integration.log'), dir: path.resolve(__dirname, '../', 'pacts'), spec: 2, cors: true, pactfileWriteMode: 'update', });```

bethskurrie
2019-05-02 11:01
You make a separate pact with that provider.

bethskurrie
2019-05-02 11:02
Same consumer name, different provider name, different port.

bethskurrie
2019-05-02 11:03
It's not going to be something that will get picked up immediately, but you can raise an issue for a future feature request.

ian.mcwilliams
2019-05-02 11:03
does global.provider become an array of Pact objects?

bethskurrie
2019-05-02 11:03
You need to assign it to a different name

bethskurrie
2019-05-02 11:04
They're managed independently.

ian.mcwilliams
2019-05-02 11:04
as in, you need a different setup file altogether?

ian.mcwilliams
2019-05-02 11:04
one per provider?

bethskurrie
2019-05-02 11:08
No, why?

bethskurrie
2019-05-02 11:09
Can't you assign more than one thing to global?

bethskurrie
2019-05-02 11:10
(I'm not really a js person, can you tell?!)

ian.mcwilliams
2019-05-02 11:13
i don't think anyone's _really_ a js person :wink: no i think it's just understanding how to separate the two, for example it could be that global.provider contains an array of Pact objects, or it could be that we have `global.provider_a` and `global.provider_b`, each containing a Pact object - i'm not sure how the pactfile job identifies relevant Pact objects so whatever we do needs to just be in line with how that job works

bethskurrie
2019-05-02 11:13
The second example is how to set it up

ian.mcwilliams
2019-05-02 11:15
ok great, thanks! hopefully @matt.fellows can help with the CI issue, if i can get that working for us then i'll quickly be onto multiple providers :+1::blush:

bethskurrie
2019-05-02 11:15
Then you just make sure that file is required before any of your pact tests

ian.mcwilliams
2019-05-02 11:16
yep that part is certainly no problem :wink:

matt.fellows
2019-05-02 11:17
I?ll be looking shortly at that issue Ian - I?m at the AWS Summit and the lights at my desk stopped working. Moving things around so that I can comfortably work :slightly_smiling_face:

bethskurrie
2019-05-02 11:18
Clarification. The lights at the summit worked fine - it's the lights on his hotel that aren't working!

matt.fellows
2019-05-02 11:20
:point_up: yes that

matt.fellows
2019-05-02 11:20
the Summit was very well organised

matt.fellows
2019-05-02 11:20
can?t brain now, so don?t expect amazing problem solving skills from me :slightly_smiling_face:

ian.mcwilliams
2019-05-02 11:21
yeah, i guess light can be considered a vital pre-requisite :laughing: cheers matt, i'll be in a meeting or two but otherwise around if there's anything i can try or info i can provide :+1:

bart.schotten
2019-05-02 11:42
Alright, thanks for clearing it up

detert
2019-05-06 07:01
has joined #pact-broker

vitaliy.grigoruk
2019-05-07 08:56
Hey folks. Does anybody use pack broker webhooks for posting status checks to consumer github commits? I?m triggering 2 provider verifications jobs (using code from master and release branches, that correspond to staging and production environments) every time consumer contract is updated on a broker. The question is: - how can I pass a link to provider CI build when verification results are published to a broker and then pass it to github status (so when I click on the link in github status check -> I got redirected to provider CI build URL instead of pact broker verification results URL). I guess that support for this should be implemented in both pact broker as well as client libraries. Right now I don?t have a possibility to trace provider verification results in pact broker to a URL of provider CI build that generated those results

bethskurrie
2019-05-07 08:57
The underlying API supports it, but I don't think it's currently used in the clients.

bethskurrie
2019-05-07 08:58
Which impl are you using?

vitaliy.grigoruk
2019-05-07 08:58
pact-js

bethskurrie
2019-05-07 08:59
Raise an issue in pact provider verifier to be able to provide the CI link via the CLI verify call.

vitaliy.grigoruk
2019-05-07 09:00
:+1: will create an issue and make a PR

vitaliy.grigoruk
2019-05-07 09:00
thanks

matt.fellows
2019-05-07 10:30
Thanks!

vitaliy.grigoruk
2019-05-07 11:24
Hi @bethskurrie. I?ve implemented it according to your suggestion, but now provider verification results are not posted back to pact broker?

bethskurrie
2019-05-07 11:52
Are you passing the right things in? It needs the provider version number, and the flag to publish the results has to be turned on.

bethskurrie
2019-05-07 11:54
It's the same underlying code, no matter how it gets the link, so if it's not publishing the verification, it's because something is not being passed in the same way. It might be a bug in the js wrapper code.

vitaliy.grigoruk
2019-05-07 12:37
I?ll keep digging then

vitaliy.grigoruk
2019-05-07 12:59
omg? there was a small typo in my code. Hate vanilla js sometimes

vitaliy.grigoruk
2019-05-07 12:59
thanks for hints, Beth

rune
2019-05-08 07:00
has joined #pact-broker

bethskurrie
2019-05-08 07:08
Do you use feature toggles @bheemreddy181? You can use the feature toggles as tag names, and generate a different contract by turning the feature toggle on.

nick.karamaniolas
2019-05-08 10:32
has joined #pact-broker

james.hattersley-dyke
2019-05-09 11:14
has joined #pact-broker

james.prescott
2019-05-10 08:40
has joined #pact-broker

mtissot79
2019-05-10 14:39
has joined #pact-broker

mtissot79
2019-05-10 14:42
Hi pact. I need the new docker image that can be run without root permissions, as the kubernetes instance on which I try to deploy does not allow root deployment. But I can not find this image on docker registry. Could you please tell me where can I find it? Thx so much

yousafn
2019-05-10 14:47
There is a link on the repo https://github.com/pact-foundation/pact-broker-docker https://hub.docker.com/r/pactfoundation/pact-broker/ but note the image is currently tagged as `edge`

brwhaley
2019-05-11 01:27
has joined #pact-broker

mtissot79
2019-05-11 14:37
Thank for the feedback. I ll try this image on Monday

bethskurrie
2019-05-12 23:39
@mtissot79 we're expecting that this will be the new standard Pact Broker deployment image, but as this particular deployment configuration is quite new, we're just making sure people know this before they use it. So far, nobody has reported any issues, and it's been out for a few weeks.

james.hattersley-dyke
2019-05-13 10:48
Hi, I'm using the broker and can-i-deploy but there's no option on the cli for a token? Only username and password?

james.hattersley-dyke
2019-05-13 10:49
i've tried `--token` and `--broker-token`

james.hattersley-dyke
2019-05-13 10:49
nothing documented in the `can-i-deploy --help` either :disappointed:

james.hattersley-dyke
2019-05-13 10:52
It's the cli embedded in pact-js if that helps

james.hattersley-dyke
2019-05-13 10:53
v8.2.0

matt.fellows
2019-05-13 11:13
Ah, that may not be in the Node JS client yet

matt.fellows
2019-05-13 11:13
Let me take a look


matt.fellows
2019-05-13 11:25
OK yep just missing the flag - should be a new release out in 30 mins @james.hattersley-dyke


james.hattersley-dyke
2019-05-13 13:16
awesome thanks Matt!

asite-rshah
2019-05-14 09:48
has joined #pact-broker

christophe.leray
2019-05-14 15:46
has joined #pact-broker

scott.riley111
2019-05-14 17:03
has joined #pact-broker

matt.fellows
2019-05-15 05:38
we?ve been discussing the pros/cons of having a hosted mock service (stub in Pact parlance) as part of http://pactflow.io. One the one hand, it wouldn?t be a huge amount of work to have any contract become an instant ?mock server? on the other you can already do it via CLI tools like the pact-stub-server at https://github.com/pact-foundation/pact-ruby-standalone/releases . Is this something people would find useful? If so, why?

kristofer.landgren
2019-05-15 07:26
has joined #pact-broker

franklin.huynh
2019-05-15 08:43
hello @matt.fellows I'm proposing the team (5 users) plan for my company as you my know. I'm getting some questions - Will it limit our developers to access to pact broker. - What will happen if there are many people login to pact broker at the same time? - What the meaning of "user" here? For example, the contract publish by user a. Will other user be able to see the contract? - What will happen if the pact broker is unavailable? Will we have a timely support only with chat and email? Could you help me with these questions?

vk.regs
2019-05-15 09:20
has joined #pact-broker

matt.fellows
2019-05-15 09:20
Hi @franklin.huynh, i?ll try to answer your questions A user is considered any person / system that requires independent access to the broker. For example, if you have a User that will be logging into the UI they will need their own user. Each user gets a single readonly and read-write API token that can be used for automation (e.g. CI or local verification). You probably only need 1 user seat per human logging into the UI. Readonly tokens can be generated for use by team members that don?t need UI access.

heymega
2019-05-15 09:21
@matt.fellows I'm just looking at PactFlow and I'm a little confused Is PactFlow just a managed broker? If so, how does it differ from the existing broker we've come to know and love?

vk.regs
2019-05-15 09:21
Hi I want to use pact files from pact broker for pact stub. Is it possible to get link to pact files in part broker?

matt.fellows
2019-05-15 09:21
> What will happen if there are many people login to pact broker at the same time? At the moment, the limit is absolute, not concurrent. So if you have more than 5 users needing access but not at the same time, this will exceed the limit

bethskurrie
2019-05-15 09:22
Yes

bethskurrie
2019-05-15 09:22
If you want to hand craft it, it will look something like `http://BROKER/pacts/provider/PROVIDER/consumer/CONSUMER/latest`



bethskurrie
2019-05-15 09:23
yup

vk.regs
2019-05-15 09:23
Bu it is looks like web page

bethskurrie
2019-05-15 09:24
curl it

vk.regs
2019-05-15 09:24
stun can undestand it?

vk.regs
2019-05-15 09:24
ok, thanks

bethskurrie
2019-05-15 09:24
you get the content type you ask for

vk.regs
2019-05-15 09:24
is it possible to get all files by one link?

bethskurrie
2019-05-15 09:24
if you open it in a browser, you get an HTML rendering. If you use the header "Accept: application/hal+json" you get the JSON

bethskurrie
2019-05-15 09:24
No, they're separate.

matt.fellows
2019-05-15 09:24
> What will happen if the pact broker is unavailable? Will we have a timely support only with chat and email? We provide email support for this tier and are implementing chat very soon. We typically respond within a few hours AEST. Our SLAs are documented in the T&Cs. As for downtime, we have invested a lot this year into the resilience and security of our infrastructure. We have zero downtime deployments and will give you at least 48 hours notice.

bethskurrie
2019-05-15 09:25
You can get all the urls for the pacts for a provider though.

matt.fellows
2019-05-15 09:26
The TL;DR is that the Developer and Team plans are hardened, highly available and secured variants of the open source broker. They have social integration (e.g. GitHub), API tokens and also a new UX

matt.fellows
2019-05-15 09:27
The business tier (which is not generally available) is where we are adding features that are _not_ Pact specific - e.g. Swagger / OAS integration

heymega
2019-05-15 09:28
You had me at "new UI" :joy:

heymega
2019-05-15 09:28
So the API endpoints are exactly the same PactFlow?

vk.regs
2019-05-15 09:29
Thanks

bethskurrie
2019-05-15 09:29
yes

heymega
2019-05-15 09:29
Also with it being managed would you provide upgrades as new version of the specification change?

bethskurrie
2019-05-15 09:29
they'll be interoperatble for all existing functionality

vk.regs
2019-05-15 09:30
One more general question: what is the best practice prepare pact files for pact stub (manually, may be some generator exists)?

bethskurrie
2019-05-15 09:30
The broker actually doesn't care about the specification version.

bethskurrie
2019-05-15 09:30
The pacts are a black box - you can actually publish any json contract.

bethskurrie
2019-05-15 09:31
Well, to be exact, the HTML rendering of the pact cares about the spec version, but if it can't parse it, it just displays the JSON.

matt.fellows
2019-05-15 09:31
But you can assume the broker will update as new changes make their way into the OSS broker. I don?t have the numbers, but I would suggest we release updates multiple times a week at a _minimum_

bethskurrie
2019-05-15 09:31
But yes, pactflow will always have the latest version of the Pact Broker code.

bethskurrie
2019-05-15 09:31
In fact, sometimes it has the code before the OSS codebase, because I'll try things out in pactflow before I do an official release of the OSS code :wink:

heymega
2019-05-15 09:32
Cool. Are the API calls still protected by basic auth or is now using something like bearer tokens?

franklin.huynh
2019-05-15 09:32
thanks Matt. Could you explain this a bit ``` So if you have more than 5 users needing access but not at the same time, this will exceed the limit ```

franklin.huynh
2019-05-15 09:33
what do you mean by this?

matt.fellows
2019-05-15 09:33
bearer tokens

franklin.huynh
2019-05-15 09:34
- Do you mean 5 users using 1 credential? - How can it still exceed the limit if they are not accessing at the same time?

matt.fellows
2019-05-15 09:35
Each User that requires access to the UI should have their own username/password

heymega
2019-05-15 09:35
Sweet! Last question before I try and steal my boss' credit card. I work for a registered charity in the UK in the education sector. Do you offer discounts?

matt.fellows
2019-05-15 09:35
> Do you mean 5 users using 1 credential? No - we wouldn?t recommend that sort of security practice

franklin.huynh
2019-05-15 09:36
it means I will have 5 credentails, right?

matt.fellows
2019-05-15 09:36
Yep!

franklin.huynh
2019-05-15 09:37
and each user can generate the token to use in term of Readonly and read-write permission?

matt.fellows
2019-05-15 09:37
There would be 5 users registered in the system, each with their own set of credentials to authenticate (or users registered through Social login via GitHub). Each user can also create API tokens for automation

franklin.huynh
2019-05-15 09:37
understood

franklin.huynh
2019-05-15 09:38
so if I understand correctly, the participants of a user will not be accessible by other users

franklin.huynh
2019-05-15 09:38
is that correct?

franklin.huynh
2019-05-15 09:38
let me clarify my question

franklin.huynh
2019-05-15 09:38
by this example

matt.fellows
2019-05-15 09:42
We haven?t had that question yet - but let?s chat offline. Can you contact us at ? If you send us what you need (i.e. number of users and anything else that comes to mind) we?ll work something out.

heymega
2019-05-15 09:43
:thumbsup:

matt.fellows
2019-05-15 09:43
:thumbsup:

richard.peckett
2019-05-15 09:57
peeps, it looks like a pull request has been completed for AMQP for Neil's pact dot net implementation; assuming will this play nicely with the new broker? :smile:

richard.peckett
2019-05-15 09:57
correction, it still looks like it's open my bad :neutral_face:


bethskurrie
2019-05-15 09:58
Yes, it will play nicely because it's the same underlying code as the JS

bethskurrie
2019-05-15 09:58
Unless someone has gone and implemented it separately...

richard.peckett
2019-05-15 09:58
awesome cheers Beth

bethskurrie
2019-05-15 09:59
hm... it may be a native impl

bethskurrie
2019-05-15 10:00
It looks like it might be a custom job

bethskurrie
2019-05-15 10:02
I wish people would talk to us first!

richard.peckett
2019-05-15 10:05
oh bollocks haha

richard.peckett
2019-05-15 10:06
I was going to have a play with this this afternoon by just signing up for your free tier pact flow broker

bethskurrie
2019-05-15 10:06
js and pact-jvm support messages

matt.fellows
2019-05-15 10:07
If it is still producing the correct pact files publishing shouldn't be hard though

matt.fellows
2019-05-15 11:37
No there is no generator. The contracts are generated by the pact tests themselves

matt.fellows
2019-05-15 11:39
Sorry had to do the bed time routine.

matt.fellows
2019-05-15 11:40
See how you go. In theory there's no reason why it can't work with the broker, even if not using the implementation in Ruby/JS etc

matt.fellows
2019-05-15 11:41
As long as you can pull in and publish the contracts independently it should be ok - we have CLI tools to communicate with the broker and then Pact Net can do the bits in between

phall
2019-05-15 13:01
has joined #pact-broker

franklin.huynh
2019-05-16 03:58
Hi, do you guys have example for webhook for trigger bitbucket pipeline

matt.fellows
2019-05-16 03:59
I haven?t seen one myself, but if you get it working, we?d love to see it make its way to https://github.com/pact-foundation/pact_broker/wiki/Webhook-template-library :pray:

franklin.huynh
2019-05-16 05:31
Please ignore my question, I already found the solution ~hey @matt.fellows I'm trying debugging about the webhook stuff. But I receieve this message~ ``` "message": "For security purposes, the response details are not logged. To enable response logging, configure the webhook_host_whitelist property. See /doc/webhooks#whitelist for more information." ``` ~I'm running docker-compose up on my local for testing but could not enable the whitelist. I update the docker-compose.yml as below but still not able to see the error message. Could you please help me?~ ``` version: "3" services: postgres: image: postgres healthcheck: test: psql postgres --command "select 1" -U postgres ports: - "5432:5432" environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: password POSTGRES_DB: postgres broker_app: image: dius/pact-broker links: - postgres # If you remove nginx, enable the following ports: - "80:80" environment: PACT_BROKER_DATABASE_USERNAME: postgres PACT_BROKER_DATABASE_PASSWORD: password PACT_BROKER_DATABASE_HOST: postgres PACT_BROKER_DATABASE_NAME: postgres webhook_host_whitelist: http://api.bitbucket.org # Nginx is not necessary, but demonstrates how # one might use a reverse proxy in front of the broker, # and includes the use of a self-signed TLS certificate # nginx: # image: nginx:alpine # links: # - broker_app:broker # volumes: # - ./ssl/nginx.conf:/etc/nginx/conf.d/default.conf:ro # - ./ssl:/etc/nginx/ssl # ports: # - "8443:443" # - "80:80" ```

franklin.huynh
2019-05-16 05:33
~I added the webhook_host_whitelist environment variable with the whitelist host~

mtissot79
2019-05-16 08:35
Hi Beth The docker image works now but I met some troubles with the security policy that my company put in kubernetes. The security policy don't allow root user or user without uid. I pulled the code from git and change a little bit the docker file: Add '-u 1000' in the useradd command Change the line 'USER ruby' to 'USER 1000' After repackaging the image, all works in k8. Maybe this could help you if other companies put this kind of policy in k8 Cheers Michael

bethskurrie
2019-05-16 08:35
Thanks. Is there any reason why we woulnd't put that in to the main code?

mtissot79
2019-05-16 11:31
First the user iud should be a parameter, and I m not a kubernetes policy expert. If a policy allow only user by username for exemple, the container will not start in k8 because of 'USER 1000'. Because I m lacking knowledge on that part, I can not submit my local modifications as a pull request.

shalygai.a
2019-05-16 11:47
has joined #pact-broker

bethskurrie
2019-05-16 12:35
Hm. OK. Maybe we could have a branch of the code and have a kubernetes tag.

arunkumarpoonia
2019-05-16 15:18
gelling below error on provide side :

arunkumarpoonia
2019-05-16 15:18
{ "rateBands": [ ... , - Pact::UnexpectedIndex, + Hash, ] }

arunkumarpoonia
2019-05-16 15:19
i am using docker image for verification

arunkumarpoonia
2019-05-16 15:21
any help will be appriciated

dagarwal
2019-05-16 16:20
when are you getting this error ?

dagarwal
2019-05-16 16:21
could you please share more information @arunkumarpoonia

bethskurrie
2019-05-16 22:07
@arunkumarpoonia the broker does not do any verification. It is a service for exchanging the contracts and the verification results. The problem you are having is during pact verification. If you look lower down in the error message you received, there is a list of the descriptions of the differences. It will include a message that says something like "array is too long". That is the problem. Your provider is return and array that is longer than the consumer expected. Your consumer should use an "each like" to say that they don't care how long the array is.

bethskurrie
2019-05-16 22:08
Hey @vitaliy.grigoruk I've updated the section in the Effective Pact Setup Guide on getting the builds set up. Can you tell me what you think of this section? https://docs.pact.io/best_practices/pact_nirvana#4-automate-the-contract-and-verification-results-exchange

heymega
2019-05-18 16:58
Couple of questions regarding PactFlows auth... I understand it supports bearer tokens. Is this using Oauth? If so, do you support non user grant types like client credentials grant? Sometimes a user won't be present especially when making calls in deployment pipelines. If not, are you planning on still supporting basic authentication alongside it?

matt.fellows
2019-05-18 22:41
The bearer token are simply API keys which can be generated by users. You can create read only and read write tokens

matt.fellows
2019-05-18 22:42
We actually support openid connect but have only inplemented GitHub (which is actually oauth2) at the moment as it was the most requested. We also support standard authentication via user/pass.

matt.fellows
2019-05-18 22:43
Basic auth is dead, because it's not ideal from a security perspective

matt.fellows
2019-05-18 22:46
Make sense?

heymega
2019-05-19 17:27
Kinda! So if these tokens need to be generated by users (by logging into GitHub), how do incorporate that into a build pipeline where a user context doesn't exist? Or are you saying we can generate long lived tokens after we've logged in? Github and Azure DevOps allow you to generate PAT (Personal Access Tokens) for this reason. Will the broker allow us to to generate these kinds of long lived tokens?

matt.fellows
2019-05-19 20:48
Yes exactly that.

matt.fellows
2019-05-19 20:48
The tokens live in the broker though, not any federated identity store

heymega
2019-05-20 08:28
Perfect, thank you.

matt.fellows
2019-05-20 08:28
:ok_hand:

vitaliy.grigoruk
2019-05-20 09:11
Hi everybody. I?ve set up pact broker webhook for github commit status https://github.com/pact-foundation/pact_broker/wiki/Webhook-template-library#github---publish-commit-status So the workflow looks the following way: 1. developer pushes a code change to a feature branch of consumer codebase. 2. consumer CI executes tests for that commit and uploads generated contract file to pact broker. 3. if published pact is different from latest one: a - pact broker executes a webhook that creates `pending` ?Pact verification? status for that github commit. b - pact broker executes a webhook that triggers provider?s CI job that verifies recently published contract. 4. provider?s CI job publishes verification results back to pact broker. 5. pact broker executes a webhook that updates consumer commit ?Pact verification? status to `passed` or `failed`. This workflow allows us to pre-verify contracts before consumer feature branches are merged into master. We use Github PRs that are merged only if all status checks are green. Github statuses for consumer commits work correctly when contract is changed (as in workflow described above). However, when it doesn?t change - there are no status checks created. I understand that new contract version inherits verification results from previous one if contract doesn?t change. It will be still nice to have a way to create a webhook event for the case when contract is published but content didn?t change. Then we can use this event to create status checks for consumer github commits even in cases if contract hasn?t changed. Any thoughts on this, @bethskurrie?

bethskurrie
2019-05-20 09:25
Firstly, that workflow is superb!

bethskurrie
2019-05-20 09:26
And secondly, yes, there is an event for pact published (rather than changed). You should use that for your github status updates. Have a look at the webhooks api docs, and you'll find it.

vitaliy.grigoruk
2019-05-20 09:54
I guess using `pact published` event instead of `pact changed` will help me to get commit statuses for all consumer commits. However, this means that provider verification CI job will be triggered every time when contract is published, rather than when contract is changed. It is fine for us for now, as we don?t have many services ?pactified?. But in a long term I?d like to avoid redundant provider verifications for the same pact contract. It would be cool if there are more events available to attach webhooks to. E.g. `contract_content_not_changed` or `provider_verification_inherited`

bethskurrie
2019-05-20 09:55
No... You have one webhook to trigger ci (pact changed) and one webhook for github statuses (pact published).

bethskurrie
2019-05-20 09:57
You won't get unnecessary ci triggers.

vitaliy.grigoruk
2019-05-20 10:06
hm? I think I know why it doesn?t work fo me? I?m triggering 2 provider verification jobs (one is running with latest `master ` branch, other with `release` branch, which correspond to `staging` and `production` provider versions). I?ve setup a webhook like this first: https://github.com/pact-foundation/pact_broker/wiki/Webhook-template-library#github---publish-commit-status and as a result I get 1 `pending` status check when new contract version is published with `context: api ` and then when both `staging` and `production` provider verifications are finished and results are published to a broker, I get 2 more statuses `context: api staging` and `context: api production`. However, pending status still remains?

vitaliy.grigoruk
2019-05-20 10:08
so, I split https://github.com/pact-foundation/pact_broker/wiki/Webhook-template-library#github---publish-commit-status webhook into 3: - 2 `contract_content_changed` webhooks that create `pending` status check for `context: api staging` and `context: api production` - 1 `provider_verification_published` webhook (same as in webhook library, but without `contract_content_changed` event.

arunkumarpoonia
2019-05-20 11:13
Hi,

arunkumarpoonia
2019-05-20 11:13
I am unable to create webhook for http url , Below error is returned :

arunkumarpoonia
2019-05-20 11:13
"scheme must be https. See /doc/webhooks#whitelist for more information."

arunkumarpoonia
2019-05-20 11:14
Is it possible to create webhook for http url, @bethskurrie can you help here pls ?

bethskurrie
2019-05-20 11:15
Did you read the docs @arunkumarpoonia?

bethskurrie
2019-05-20 11:15
The one referenced in the error message?

bethskurrie
2019-05-20 11:16
Are you using your own broker, or the DiUS hosted one?

arunkumarpoonia
2019-05-20 11:21
I am using my own broker

bethskurrie
2019-05-20 11:21
I'm still confused. You should only need 2 webhooks. One that updates github on contract published and provider verification published. And one that triggers the ci on contract content changed.

bethskurrie
2019-05-20 11:22
Can you go the the url on your own broker that the error message tells you to?

arunkumarpoonia
2019-05-20 11:26
Thanks Beth, Will take a look

bethskurrie
2019-05-20 11:26
Arun, is there a problem with that message?

bethskurrie
2019-05-20 11:27
"See /doc/webhooks#whitelist for more information."

bethskurrie
2019-05-20 11:27
Is it confusing because it's a relative link?

arunkumarpoonia
2019-05-20 11:29
its fine, i am able to see details on this screen - hal-browser/browser.html#/webhooks/provider/-test-API/consumer/test-UI


vitaliy.grigoruk
2019-05-20 11:30
yeah, this works well when I?m verifying contract with only one version of provider. When I?m triggering 2 CI provider verification jobs (master and release branches), this setup doesn?t work as desired. I?d like to get 2 statuses for each consumer github commit: - `provider release branch` - `provider master branch`

bethskurrie
2019-05-20 11:36
Isn't that what the provider tags in the context does?

bethskurrie
2019-05-20 11:37
Which pending status still remains?

bethskurrie
2019-05-20 11:38
Maybe you could take a series of screenshots of the github PR statuses for me, and send me the json for the webhooks you're working on, and I'll see if I can nut it out.

bethskurrie
2019-05-20 11:40
I've got to go to bed ( :flag-au:) but send what you can to and I'll have a look in the morning.

vitaliy.grigoruk
2019-05-20 12:02
:+1:

vitaliy.grigoruk
2019-05-20 20:45
I?ve decided it would be better to make it publicly available instead @bethskurrie

franklin.huynh
2019-05-21 00:18
Added

matt.fellows
2019-05-21 00:23
Thanks man!

jinal
2019-05-21 05:56
has joined #pact-broker

sankalan13
2019-05-21 05:56
has joined #pact-broker

sankalan13
2019-05-21 06:01
Hi guys Very new to pact and I'm trying to create webhooks from the free hosted pact-broker "Pact-flow". I want to know how I can set the 'PACT_BROKER_WEBHOOK_HOST_WHITELIST' env variable when I am using the hosted broker. For the docker-compose broker, I can easily set it in the compose file itself.

bethskurrie
2019-05-21 06:03
You can't at the moment.

bethskurrie
2019-05-21 06:03
Let me look into it and see if I can made this customisable at a tenant level though.

bethskurrie
2019-05-21 06:04
Can I ask what you're connecting to that's on the public internet but isn't https?

sankalan13
2019-05-21 06:08
Thank you for the quick response :slightly_smiling_face: I wanted to make webhook triggers for slack and github but in the locally hosted docker pact-broker, i could not make the webhook triggers work unless I whitelisted the urls. I was thinking its the same case with pact-flow. (Asked the question without trying out first) Have these URLs already been whitelisted in pact-flow? @bethskurrie

bethskurrie
2019-05-21 06:09
Slack and github run on https

bethskurrie
2019-05-21 06:10
And yes, all domains are whitelisted.

sankalan13
2019-05-21 06:11
Awesome thank you so much for that. Is there any documentation for pact-flow currently?

bethskurrie
2019-05-21 06:12
All the OSS documentation applies to pactflow currently. We're working on creating separate docs, as we add new features that aren't available in the OSS version.

sankalan13
2019-05-21 06:19
Got it. Thanks a ton Beth :slightly_smiling_face:

sankalan13
2019-05-21 11:20
Hi guys I am using the pact-verifier to get my pact file from pact-flow and use it to verify my provider. This is the exact code I have been using: ```pact-verifier --provider-base-url="http://localhost:8000" --pact-url="https://springboard.pact.dius.com.au/pacts/provider/paymentcallutilityservice/consumer/ui/latest/" --provider-states-setup-url="http://localhost:8000/_pact/provider_states/" --custom-provider-header="Authorization: Bearer ***********" -a "0.0.2" -r``` Here are a few things I have tried: 1) Changing the bearer token on the --custom-provider-header tag and putting it in the URL 2) Added and removed --pact-broker-username="********" --pact-broker-password="******" 3) Used the ruby pact-provider-verifier gem instead of the one with python 4) used the actual version of the pact in the pact flow instead of /latest/ tag 5) changed the localhost base urls to actual server running on kubernetes 6) using the old --broker-token from pact-provider-verifier None of the above has resolved the issue. The error I am getting is ```Error reading file from https://springboard.pact.dius.com.au/pacts/provider/paymentcallutilityservice/consumer/ui/latest/ HTTP request failed: status=401 /Users/Sankalan/.virtualenvs/work/lib/python2.7/site-packages/pact/bin/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.7.2/lib/pact/consumer_contract/pact_file.rb:69:in `block in get_remote_with_retry'``` With stack trace to follow. P.S. Is this the right channel for these questions or should I direct them to some other channel. :slightly_smiling_face:

bethskurrie
2019-05-21 11:22
Are you using pact python?

bethskurrie
2019-05-21 11:23
I think the verifier needs updating to support the bearer token.

bethskurrie
2019-05-21 11:23
Try using the docker pactfoundation/pact-cli instead.

bethskurrie
2019-05-21 11:24
--broker-token is the parameter.

sankalan13
2019-05-21 11:28
Yes I am using pact python. Okay trying it :slightly_smiling_face: thank you

sankalan13
2019-05-21 12:09
Hey @bethskurrie Thank you for guiding me in the right direction. I updated the latest version of pact-provider-verifier and now the --broker-token is visible to me. I am using this command now: ```pact-provider-verifier --pact-broker-base-url="https://springboard.pact.dius.com.au/" --provider-base-url="http://localhost:8000" -c "http://localhost:8000/_pact/provider_states" --broker-token="**********" -a "0.0.1" -r -v --provider=paymentcallutilityservice``` The error changed, before I wasn't able to retrieve the URL but I am still getting a 401 unauthorized. I am not able to get my pact file from the pact-flow server using my bearer token. I even tried using the basic auth but that also doesnt seem to work. ```INFO: Fetching pacts for paymentcallutilityservice from https://springboard.pact.dius.com.au/ for tags: latest 0.0.2 opening connection to http://springboard.pact.dius.com.au:443... opened starting SSL for http://springboard.pact.dius.com.au:443... SSL established <- "GET /? HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: application/hal+json\r\nUser-Agent: Ruby\r\nAuthorization: Basic amluYWxAc3ByaW5nYm9hcmQuY29tOkppbmFsQDEyMw==\r\nHost: http://springboard.pact.dius.com.au\r\n\r\n" -> "HTTP/1.1 401 Unauthorized\r\n" -> "Date: Tue, 21 May 2019 12:02:27 GMT\r\n" -> "Content-Type: text/plain\r\n" -> "Content-Length: 0\r\n" -> "Connection: keep-alive\r\n" -> "Status: 401 Unauthorized\r\n" -> "X-Pact-Broker-Git-Sha: 742d506c8cd63cc4c7e25aecfb0e31ab2af3a7e5\r\n" -> "WWW-Authenticate: Basic realm=\"Restricted area\"\r\n" -> "X-Saas-Broker-Git-Sha: deb11516a75e3b5052b6f634fa71603e35b4add7\r\n" -> "X-Pact-Broker-Version: 2.31.0\r\n" -> "X-Request-Id: ab2e290d9bae7a74fdb0fb3d12b9124d\r\n" -> "X-Frame-Options: SAMEORIGIN\r\n" -> "X-XSS-Protection: 1; mode=block\r\n" -> "X-Content-Type-Options: nosniff\r\n" -> "Referrer-Policy: strict-origin\r\n" -> "Strict-Transport-Security: max-age=31536000 ; includeSubDomains\r\n" -> "\r\n" reading 0 bytes...``` pactfoundation/pact-cli only has a publish option and a can-i-deploy option. It does not have an option from where I can verify my provider.


sankalan13
2019-05-22 03:48
Thanks Matt. I will try that too. I found the problem yesterday (I guess? :p) Pact version release 1.40.0 supports broker token but pact-provider-verifier gem uses pact 1.38.0 version release. I think this is the problem. When I remove 1.38 and install 1.40, pact mock service gem collides and raises version conflict. ```Unable to activate pact-message-0.5.0, because pact-mock_service-3.1.0 conflicts with pact-mock_service (~> 2.6) (Gem::ConflictError)``` because pact-mock_service depends on pact-message 0.5.0. I am not sure if the current pact-broker-verifier is compatible with the --broker-token field.

bethskurrie
2019-05-22 03:48
I'm in the process of fixing it.

bethskurrie
2019-05-22 03:48
In the meantime, set the env var PACT_BROKER_TOKEN and it should work.

bethskurrie
2019-05-22 03:50
The verification process executes a command, and that command gets printed to the terminal. I didn't want to have the token printed to the terminal - hence the use of the env var.

bethskurrie
2019-05-22 03:50
I'd missed hooking up the --broker-token param to the env var though.

matt.fellows
2019-05-22 04:43
Thanks for fixing Beth.

sankalan13
2019-05-22 05:22
Thanks Beth. Can you give a tentative estimate as to when the fix will be out?

matt.fellows
2019-05-22 05:38
The fix is out in the standalone and pact js. Where do you need it?

sankalan13
2019-05-22 05:46
I am using the pact-provider-verifier gem and I see that the fix is out as pact-provider-verifier is using pact 1.40.0 but the provider verification is still failing for me somewhere in the pact-support 1.10.2 version. I'm trying to get to the bottom of it but I have a hunch that the broker token is not propagating through. Will send a screenshot of the stack trace

sankalan13
2019-05-22 05:52
This is the stack trace I am getting. The first two times, the broker token is being propagated to the header when accessing the pactflow url and then the /provider/name/latest url. But as soon as the verifier tries to access the actual pact file url, the broker token is not passed with it. Because of which I am not able to read the file. I am still trying to find the exact problem. Maybe you guys will know it quicker if there is a problem here.

sankalan13
2019-05-22 05:55
@matt.fellows pact standalone is still using pact 1.38.0 so pact-provider-verifier is failing on it.

sankalan13
2019-05-22 05:57
Sorry my bad, pulled the 1.65 version instead of 1.66

sankalan13
2019-05-22 05:58
Fixed in standalone. Thank you so much guys!!! Wohoooooooo

matt.fellows
2019-05-22 06:11
:+1:

matt.fellows
2019-05-22 06:11
:laughing:

sankalan13
2019-05-22 07:27
Pact support is awesome!! You guys are so proactive!! Highly appreciated :smile:

bethskurrie
2019-05-22 07:28
No problem!

anabalfun
2019-05-22 09:14
has joined #pact-broker

qatrera
2019-05-22 10:51
Hi! We are wondering if this endpoint `DELETE /pacts/provider/{provider}/consumer/{consumer}/tag/{tag}` will delete a pact that has more than one tag. For instance, I have a pact tagged with `['production', 'my_branch_name']` and I delete the pacts with tag `'my_branch_name'` using the mentioned endpoint, will my pact be deleted too? or it will only remove the `'my_branch_name'` tag?

vitaliy.grigoruk
2019-05-22 11:01
I?d expect that request mentioned above should delete tags only

vitaliy.grigoruk
2019-05-22 11:03
but I?ll let somebody else to answer this question

detert
2019-05-22 11:06
My guess: It deletes a tag. Why don't you just try it?

bethskurrie
2019-05-22 11:26
It deletes the pacts, regardless of whether they have other tags.

bethskurrie
2019-05-22 11:27
I have had the thought though that it would be better to make it just remove the tag if there are other tags attached, so you can keep all your prod pacts, but remove ones from a branch you're no longer using.

bethskurrie
2019-05-22 11:28
I'm not sure when I'll get around to it, but can you raise it as a feature request?

qatrera
2019-05-22 12:03
> I have had the thought though that it would be better to make it just remove the tag if there are other tags attached, so you can keep all your prod pacts, but remove ones from a branch you're no longer using. that's the use case we were thinking (still trying to figure some things out around Pact) but we were concerned we could potentially overload the broker with no longer used pacts.

qatrera
2019-05-22 12:25
we'll investigate a bit more and create the feature request if we need to (and try to create a PR for it)

qatrera
2019-05-22 12:25
thanks for the quick response!

detert
2019-05-22 15:59
Hi. I call the `pact-provider-verifier` with a https broker url, however the publish-verify-results call seems to try to call http (I get a redirect from my webserver at port 80). Is that a known issue?

matt.fellows
2019-05-22 21:24
Can you prove/demonstrate this? That would definitely be a new bug and is not intended behavior

detert
2019-05-24 06:07
Well yes. I disabled the http to https redirect in Apache and now it works

matt.fellows
2019-05-24 06:11
that would imply that you were configuring it with an http url - I?m concerned if you?re removing that redirect (seems like a good security practice)


detert
2019-05-24 06:22
I can add the redirect again, if it works. Currently everything is internally

detert
2019-05-24 06:24
The successful version even states published to http:// even if I provide https://

detert
2019-05-24 06:26
I added the success log to the issue

detert
2019-05-24 06:26
I have to leave for now, I'll be back later

matt.fellows
2019-05-24 06:26
thx

matt.fellows
2019-05-24 06:26
np

qatrera
2019-05-24 09:51
Hi again! :wave: Context: we are using pact_broker_docker FROM dius/pact-broker:2.31.0-1. Our Jenkins has 'Prevent Cross Site Request Forgery' enabled so in order to trigger a Jenkins job from a webhook we also need to pass a valid `crumb` . This `crumb` is obtained by doing an extra request. Has someone configured a broker webhook successfully with this setting enabled? As far as I know this `crumb` has a TTL, so we can't avoid to perform the auth request first. But in the webhook we can only configure one request. We would really like to avoid to create a proxy service for this if possible. If someone has more ideas we would really appreciate it :blush:


vitaliy.grigoruk
2019-05-24 09:58
Use ?Authentication Token? for each job

qatrera
2019-05-24 10:09
omg, it works! I thought we already tried that! Thanks!!! :heart:

bethskurrie
2019-05-24 10:45
Great!

bethskurrie
2019-05-24 10:46
Also, check out the latest broker image at pactfoundation/pact-broker. It's much smaller and runs without root permissions. We'll be retiring the one you're using @qatrera

bethskurrie
2019-05-24 10:46
The same configuration options apply to the new one, you can literally just swap pactfoundation for dius.

qatrera
2019-05-24 10:51
ah, didn't know that, we'll check!

qatrera
2019-05-24 10:51
thanks @bethskurrie!

qatrera
2019-05-24 11:15
Following this comment by @bethskurrie https://pact-foundation.slack.com/archives/C9VPNUJR2/p1558694762008600?thread_ts=1558691514.007300&cid=C9VPNUJR2 we saw that for the new `pactfoundation/pact-broker` there aren't any tags published https://hub.docker.com/r/pactfoundation/pact-broker/tags (compared with the dius one https://hub.docker.com/r/dius/pact-broker/tags). Would it be possible to have some version tags there? It would help debugging (among other things :slightly_smiling_face: ). Thanks!

bethskurrie
2019-05-24 11:25
Good point @qatrera. We've just been running it in beta for the last few weeks to make sure there weren't any issues.

bethskurrie
2019-05-24 11:25
That's why there's only the edge tag. Nobody has reported anything however, so I reckon we can make an official release.

borsuk.artem034
2019-05-24 15:05
~Hi folks, I need get latest provider version for webhook, I'm try to use ${pactbroker.providerVersionNumber}, but it is empty~ Never mind :slightly_smiling_face: it works when you publish contract and webhook triggered, but not work when you do debugging

borsuk.artem034
2019-05-24 15:09
~more details: I have separate job for running "pact-provider-verifier" which I want to run via webhook in bamboo ...rest/api/latest/queue/PLAN?&amp;bamboo.ENVIRONMENT=${pactbroker.consumerVersionTags}&amp;bamboo.variable.PROVIDER_VERSION=${pactbroker.providerVersionNumber}~

borsuk.artem034
2019-05-25 06:15
Question regarding the previous one, do we have a possibility for new consumer contract set the latest provider version by the same tag as a new consumer?

bethskurrie
2019-05-25 06:16
I'm sorry @borsuk.artem034, I don't understand the question

bethskurrie
2019-05-25 06:17
@borsuk.artem034 are you triggering a provider verification from a webhook? You should pass the URL of the changed pact to the verification job.


borsuk.artem034
2019-05-25 06:46
@bethskurrie np, my fault, I should describe the problem with details. So: 1. Consumer change the contract and version 2. In pact broker, we can see a new line with the version of consumer and empty provider version 3. For trigger "pact-provider-verifier" via webhook in CI, I need pass the TAG and Provider-version The problem in step 3, I don't know how I can specify a provider version

bethskurrie
2019-05-25 06:46
You don't typically specify the tag and provider version.

bethskurrie
2019-05-25 06:47
typically you'd trigger a CI job, and that would just use the latest version of the code (or a set branch/git tag)

borsuk.artem034
2019-05-25 06:50
hmm, just for verification or build provider?

bethskurrie
2019-05-25 06:50
for verification.


bethskurrie
2019-05-25 06:51
The consumer doesn't tell the provider which version it should be verified by - the provider decides that.

borsuk.artem034
2019-05-25 06:55
yep, I read already, in that case verification result will be not published, because for publishing require parameter --provider-app-version

bethskurrie
2019-05-25 06:56
that's on the provider side...

bethskurrie
2019-05-25 06:57
the pact gets generated by the consumer tests, published to the broker, the broker triggers a provider verification job in the provider's CI, which checks out the latest version of the code, and verifies the pact at the URL that was passed to it from the webhook. That's the job that needs to know the provider version. It publishes the verification result back to the pact broker with the provider version.

bethskurrie
2019-05-25 06:57
it's the provider job - it should know the provider version.

bethskurrie
2019-05-25 06:58
The webhook does not know anything about the provider version.


borsuk.artem034
2019-05-25 07:11
mmm, let's proceed with example (sorry for annoying you, i just want solid understanding) 3. webhook pass TAG and run Provider verifying 4. Provider verifying job should checkout latest code base and take branch name and hash commit Is the correct way?

bethskurrie
2019-05-25 07:11
> webhook pass TAG and run Provider verifying

bethskurrie
2019-05-25 07:12
The webhook just passes the URL of the changed pact.

bethskurrie
2019-05-25 07:12
> Provider verifying job should checkout latest code base and take branch name and hash commit Yes.

bethskurrie
2019-05-25 07:13
The job for the webhooks (when the pact changes) is different from your normal provider CI pipeline.

bethskurrie
2019-05-25 07:14
The normal provider pipeline is triggered when you commit your provider, and that's the one where you give it specific consumer version tags to verify.


borsuk.artem034
2019-05-25 07:15
In tag I'm specify environment (like test1, test2, stage...) so, if contract changed on test2 then provider to verifing will be on test2 too

bethskurrie
2019-05-25 07:15
if you want to put smarts into the logic, then you'll need an intermediate CI job to trigger the right provider job.

bethskurrie
2019-05-25 07:17
typically you tag with the environment when you deploy

bethskurrie
2019-05-25 07:17
not when you publish a pact.

borsuk.artem034
2019-05-25 07:18
oh, it is my omission, pact published during deploy in my case

bethskurrie
2019-05-25 07:18
why?

bethskurrie
2019-05-25 07:19
you don't know if you're safe to deploy yet.

bethskurrie
2019-05-25 07:19
typically you'd go 1. generate pact 2. publish pact (you don't know if it will pass verification yet) and tag with branch name 3. use can-i-deploy to check the status of the pact 4. deploy if it is green 5. tag with the environment name

bethskurrie
2019-05-25 07:23
Do you have an unusual deployment pipeline?

borsuk.artem034
2019-05-25 07:31
Some kind, we have separate build plans which create a docker images(during build pact generated), then deploy images on environment(during deploy - pact published with version (imageName-commitHash) and runed can-i-deploy)

borsuk.artem034
2019-05-25 07:33
I thought it will be suitable solution, but after talk with you I don't know

bethskurrie
2019-05-25 07:34
you shouldn't separate the pact generation from the pact publication.

bethskurrie
2019-05-25 07:34
you need to publish and get the verification results before you know you're safe to deploy.

bethskurrie
2019-05-25 07:35
otherwise, you could put whatever you liked in a pact, and deploy it to the environment - but it would not work with the provider.

borsuk.artem034
2019-05-25 07:43
yeah, I made a big mistake, many thanks for your time and returning me in the right direction

bethskurrie
2019-05-25 07:43
:thumbsup::skin-tone-3:

monch1962
2019-05-27 21:27
has joined #pact-broker

diandra
2019-05-28 00:21
has joined #pact-broker

s1apped
2019-05-28 09:47
Hi. I'm trying to run pact broker docker on aks cluster and postgres database. Looks like pod and service is up and running but unable to connect to HAL and there is nothing in logs ( running it in DEBUG ). I suspect some issues with DB connection but I'm not able to troubleshoot. cat /var/log/nginx/access.log is empty.

bethskurrie
2019-05-28 09:51
Have you found the debugging page on the wiki?


s1apped
2019-05-28 09:54
yes I followed it

bethskurrie
2019-05-28 09:54
I'm not sure how much we can help you because it sounds like you're having problems with the environment more so than the broker itself.

bethskurrie
2019-05-28 09:55
Can you run a local docker instance connecting to the same database?

bethskurrie
2019-05-28 09:58
If it had started up and was unable to connect, you should see some logs somewhere indicating that. It seems to me like the broker process isn't even starting.

s1apped
2019-05-28 09:59
*** Running /etc/my_init.d/00_regen_ssh_host_keys.sh... *** Running /etc/my_init.d/10_syslog-ng.init... May 28 09:16:10 pactbroker-5b8f46c966-89w67 syslog-ng[13]: syslog-ng starting up; version='3.13.2' *** Running /etc/my_init.d/30_presetup_nginx.sh... *** Booting runit daemon... *** Runit started as PID 22 May 28 09:16:11 pactbroker-5b8f46c966-89w67 cron[27]: (CRON) INFO (pidfile fd = 3) May 28 09:16:11 pactbroker-5b8f46c966-89w67 cron[27]: (CRON) INFO (Running @reboot jobs) ok: run: /etc/service/nginx-log-forwarder: (pid 31) 0s May 28 09:17:01 pactbroker-5b8f46c966-89w67 CRON[57]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)

s1apped
2019-05-28 09:59
these are the only logs I see

bethskurrie
2019-05-28 10:00
Try running the new puma docker image.

bethskurrie
2019-05-28 10:00
It's in pactfoundation/pact-broker

bethskurrie
2019-05-28 10:01
Maybe it's a permissions issue. Are you running it with root?

bethskurrie
2019-05-28 10:01
The new image doesn't need root.

s1apped
2019-05-28 10:01
let me try new image

s1apped
2019-05-28 10:07
now it

s1apped
2019-05-28 10:07
is better :wink: I was using dius image

s1apped
2019-05-28 10:08
now pactfoundation/pact-broker:edge

s1apped
2019-05-28 10:08
and way better

bethskurrie
2019-05-28 10:08
the new one is a fork of the dius one, which one of our contributors converted from nginx to puma, and made it a heap smaller.

s1apped
2019-05-28 10:13
thank you

antonello
2019-05-28 11:01
Hi! My client and I are investigating how do tagging in the Pact Broker during deploys/flips from blue to green in production. Since the `latest` tag is determined by the version number being tagged, we are unsure how to handle situations in which we decide to flip back to the old version. Here?s an example to illustrate this: 1. Latest `prod` tag is `2.5.0` ```$ pact-broker describe-version --pacticipant a_pacticipant --latest prod --broker-base-url http://localhost:5080 NUMBER | TAGS -------|----- 2.5.0 | prod``` 2. I deploy `2.6.0` and tag it as `prod`: ```$ pact-broker create-version-tag --pacticipant= a_pacticipant --broker-base-url=http://localhost:5080/ --version=2.6.0 --tag prod Tagging a_pacticipant version 2.6.0 as prod``` 3. Pact Broker is now reporting 2.6.0 as the latest `prod` tag. All good ```$ pact-broker describe-version --pacticipant a_pacticipant --latest prod --broker-base-url http://localhost:5080 NUMBER | TAGS -------|----- 2.6.0 | prod``` 4. Let?s assume something is wrong and I want to flip back to 2.5.0. I retag 2.5.0 as prod. (This is a no-op I assume) ```$ pact-broker create-version-tag --pacticipant= a_pacticipant --broker-base-url=http://localhost:5080/ --version=2.5.0 --tag prod Tagging a_pacticipant version 2.5.0 as prod``` 5. But the Pact Broker reports that latest `prod` is still ´2.6.0` ! ```$ pact-broker describe-version --pacticipant a_pacticipant --latest prod --broker-base-url http://localhost:5080 NUMBER | TAGS -------|----- 2.6.0 | prod```

bethskurrie
2019-05-28 11:01
If you want to return to a previous version, you need to delete the prod tag from the version you un-deployed.

antonello
2019-05-28 11:02
I was looking for documentation on how to delete a tag, but couldn?t find any. Will the HAL browser give me the answer I?m looking for? :slightly_smiling_face:

antonello
2019-05-28 11:02
I haven?t looked yet

bethskurrie
2019-05-28 11:02
I have been considering altering the behaviour of "latest" so that it could work like you said.

bethskurrie
2019-05-28 11:02
Send a delete to the URL of the tag.

bethskurrie
2019-05-28 11:02
You will find the tags in the HAL browser.

bethskurrie
2019-05-28 11:03
DELETE `/pacticipants/:pacticipant/versions/:version/tag/:tag`

antonello
2019-05-28 11:03
awesome!

bethskurrie
2019-05-28 11:04
I was just checking if I'd done a delete in the CLI, but it seems not yet

antonello
2019-05-28 11:04
yep - I looked that first

bethskurrie
2019-05-28 11:04
if you raise an issue, i'll see if I can get it in some time.

antonello
2019-05-28 11:04
well, making an API call these days is cheap, but I will also suggest a PR :slightly_smiling_face:

bethskurrie
2019-05-28 11:05
warning, I'm crazy busy with Pactflow right now, but hopefully I'll get to it!

antonello
2019-05-28 11:06
I didn?t know anything about Pactflow! I?ll check it out!

bethskurrie
2019-05-28 11:06
It's a SAAS version of the Pact Broker, with extra bells and whistles.

bethskurrie
2019-05-28 11:07
Proper auth, better UI, Swagger support comming

bethskurrie
2019-05-28 11:07
http://pactflow.io if you're interested

antonello
2019-05-28 11:07
Well, the guys at Treatwell could look into creating a PR to add the ability to delete a TAG via che pact broker cli. It shouldn?t be too bad

bethskurrie
2019-05-28 11:08
that would be awesome!

bethskurrie
2019-05-28 11:08
it should be quite straightforward, though the code in that repo is a mix of old Beth code (6 years ago) and new Beth code (shiny!) so not all of it in there is a good pattern to copy!

bethskurrie
2019-05-28 11:08
I think the create-version-tag is recent enough though.

s1apped
2019-05-28 12:20
is there an option to change url root path from http://my.broker.com to http://my.broker.com/pact?

matt.fellows
2019-05-28 12:23
if you?re hosting your own, you?d probably need to do some magic with whatever reverse proxy you put in front of it (e.g. rewrite rules) or modification to the Ruby app itself (it?s probably possible with some magic in http://config.ru or a separate piece of middlelware)

matt.fellows
2019-05-28 12:23
but I?ve not tried myself

s1apped
2019-05-28 12:24
thanks :slightly_smiling_face:

matt.fellows
2019-05-28 12:29
np

daniel.tattan.birch
2019-05-28 16:02
has joined #pact-broker

pact.io
2019-05-28 16:42
has joined #pact-broker

diandra
2019-05-28 19:00
Hi , im starting with pact, I want to publish my pact in Pactflow, I have copnfiguration my publish.js file, when I run it I get an authentication failure (the username and password is correct), some idea that could be wrong :disappointed:

matt.fellows
2019-05-28 22:12
You should be authenticating using the bearer token mechanism. My guess is that you?re trying to use your username (email address) + password.

matt.fellows
2019-05-28 22:13
Head to settings, grab a token (read/write) and then user the `pactBrokerToken` property


detert
2019-05-29 06:11
Two thoughts: Did you try to fix the warning "Insecure world writeable"? And are you able to publish contracts using just CURL?

bart.schotten
2019-05-29 09:35
We're using version 2.31.0-1 of the dius/pact-broker docker image, no custom configuration. We using only Git hashes as pacticipant versions (no semver). According to https://github.com/pact-foundation/pact_broker/wiki/Configuration#ordering-versions-by-date it should sort by date by default, but... it doesn't. Even after uploading a new version. Am I wrong about the expected behavior here?

bethskurrie
2019-05-29 09:36
There's a bug if it doesn't.


bethskurrie
2019-05-29 09:41
What ordering are you seeing @bart.schotten? Random? Can you create a script to recreate the issue, and raise an issue in the pact-broker-docker repository, I'll have a look at it.

bart.schotten
2019-05-29 10:41
It seems to be completely random

bart.schotten
2019-05-29 10:47
It might be relevant that most of these were uploaded when we had an old version deployed (without the default sorting by date).

bethskurrie
2019-05-29 10:47
Ah. Yes. It won't resort the old versions.

bethskurrie
2019-05-29 10:48
As long as the new ones are going in the right order, it's working as expected.

bart.schotten
2019-05-29 10:48
Ok, that clears things up at least. I guess I'll have to delete older versions then.

bethskurrie
2019-05-29 10:49
Are they causing problems?

bart.schotten
2019-05-29 10:49
Yeah, old versions keep being listed as "latest"

bethskurrie
2019-05-29 10:49
Usually you only deal with the latest version, or the latest tagged version. Anything else becomes irrelevant.

bethskurrie
2019-05-29 10:49
That shouldn't happen.

bethskurrie
2019-05-29 10:50
But if you're OK with it, I would just delete them and start again.

bethskurrie
2019-05-29 10:50
If you notice any problems, with the clean env, raise an issue.

bart.schotten
2019-05-29 10:52
I'll do that. Thanks for the help.

bethskurrie
2019-05-29 10:52
Having semantic versioning at all turned out to be the wrong decision! It was written in an environment where everything was semantically versioned. You live and learn!


matt.fellows
2019-05-29 22:03
What do you mean by support?

matt.fellows
2019-05-29 22:04
Looks like a personal project of a maintainers, but if you had issues I'm sure they'll support it if it doesn't get answered here

bethskurrie
2019-05-30 04:35
The newer, smaller, sleeker, un-rootier, and downright sexier Pact Broker Docker image is now officially released. Get yours at `pactfoundation/pact-broker:2.32.0-2`. It is fully backwards compatible with the environment variables from the previous `dius/pact-broker` image, but now runs on port 9292 by default so it doesn't need root (and this port is configurable). Many thanks to @stipud for his work on this!

stipud
2019-05-30 04:35
has joined #pact-broker

abubics
2019-05-30 04:40
> downright sexier

bethskurrie
2019-05-30 04:41
It totally is.

bethskurrie
2019-05-30 04:42
While I've got your attention, some new features that have been added to the UI recently: ? Delete a single pact ? Delete all pacts between a consumer/provider ? Delete an entire integration and all related objects (consumer/provider/webhooks etc)

bethskurrie
2019-05-30 04:43
So go crazy, DELETE ALL THE THINGS! You can just republish them anyway...

tjones
2019-05-30 05:18
So great! Thanks @bethskurrie and @stipud

vitaliy.grigoruk
2019-05-30 05:25
just our of curiosity, did anybody deploy pact-broker to Heroku?

stipud
2019-05-30 06:38
Hey everyone! I'm glad I could help. :relaxed:

rafael.anachoreta
2019-05-30 07:29
amazing stuff! :heart_eyes:

oswald.quek
2019-05-30 08:44
Thanks @bethskurrie @stipud !

sankalan13
2019-05-30 09:24
Will these features be available in pactflow as well?

laverya
2019-05-30 17:33
has joined #pact-broker

pat.vongphrachanh
2019-05-30 18:58
has joined #pact-broker

bethskurrie
2019-05-30 23:42
The buttons haven't been added to the new UI yet @sankalan13, but you can always switch to the old (OSS) UI to access them. There's an "old ui" toggle button at the top of the page.

bethskurrie
2019-05-30 23:44
@vitaliy.grigoruk I can't remember anyone specific, but I can't see a reason why it wouldn't work.

bethskurrie
2019-05-30 23:45
The pact-jvm and ruby clients have retries built into them so if it takes a while to come up, there shouldn't be any noticeable side effects.

sankalan13
2019-05-31 05:52
Thanks Beth. Will have a look.

detert
2019-05-31 13:03
Does someone use Gitlab together with pact-broker? I am searching for ideas on how to integrate can-i-deploy before a merge request might be merged into master

bethskurrie
2019-06-01 03:45
This may help



bethskurrie
2019-06-01 03:49
If you want to get complex about it, this approach may help you @detert https://github.com/pact-foundation/pact_broker/issues/273#issuecomment-494184798

pact.io
2019-06-01 10:39
Hi @bethskurrie. Thank you very much. I'll take a closer look at it

bethskurrie
2019-06-01 21:51
Hey broker users. I'm coming up with a design for webhook secrets that can be substituted into the webhooks at runtime (eg tokens, passwords, auth headers). Can anyone see a use for *non-secret* user defined parameters in webhooks?

pact.io
2019-06-01 23:51
I am not sure if I understand what you are doing

bethskurrie
2019-06-01 23:57
You know how you can use predefined webhook template parameters? Eg ${pactbroker.consumerVersionNumber} ? I'm making user defined ones that will be encrypted and redacted from the logs for things like api tokens.

bethskurrie
2019-06-01 23:57
"secrets"

bethskurrie
2019-06-01 23:58
But that made me wonder if there was a use case for user defined template parameters that weren't secret. Like ${repositoryBaseUrl}

bethskurrie
2019-06-01 23:59
To dry up the webhook definitions.

pact.io
2019-06-02 00:35
Well, that is a good question. Do I understand it right that the main point is: "should all user defined variables be encrypted in the logs?"

thakkarjinal29
2019-06-03 04:02
has joined #pact-broker

vitaliy.grigoruk
2019-06-03 11:59
The only case where I would use ?non-secret? user-defined params are ?githubOrgName?, ?ci base url?, ?bot usernames for CI / github?. Are these user-defined params shared for all webhooks or maybe somehow scoped to consumer or provider?

bethskurrie
2019-06-03 12:06
They'd be global at this stage.

bethskurrie
2019-06-03 12:07
Yes, those are the kinds of things I'd imagine using global parameters for. But does anyone ever actually use them? :-P

bethskurrie
2019-06-03 12:09
@detert anything user defined that isn't secret would not be redacted from the logs, the way thing like pacticipant names are not redacted from the logs.

bheemreddy181
2019-06-03 18:28
Can I consider can-i-deploy something like can-i-merge? i don't want to merge bad contract changes to master

bethskurrie
2019-06-03 20:01
Yes @bheemreddy181

bheemreddy181
2019-06-03 20:06
Cool - Can you do a write-up regards to the same or if you have a write up can you share it for the workflow ?

bheemreddy181
2019-06-03 20:35
@bethskurrie Can i pass a dynamic tag name in here for consumer on provider_verification ? https://github.com/pact-foundation/pact-ruby/wiki/Verifying-pacts#fetching-pacts-from-a-pact-broker

bheemreddy181
2019-06-03 20:44
Something like this

bheemreddy181
2019-06-03 20:44
```consumer_version_tags [ENV['PACT_CONSUMER_TAGS'], 'prod']```

bethskurrie
2019-06-03 23:17
@bheemreddy181 yes, absolutely. Some people follow a branch based consumer/provider workflow where the consumer branches, creates a tag with the branch name, then the provider makes a branch with a matching name, and then pulls in the pact for that tag (as well as prod).


bethskurrie
2019-06-03 23:21
If you follow a build pipeline like this https://github.com/pact-foundation/pact_broker/wiki/Webhooks#consumer-ci that calls "can-i-deploy" directly after all the isolated tests, then it will cause any branch builds with new expectations to fail because they're not yet verified.

kristofer.landgren
2019-06-04 11:23
I am getting the following error message when I try to run the dius/pact-broker container in AWS ECS (fargate). It has worked before but I haven't restarted the server for a few months. Now when I start my pactbroker logs says this: ``` 2019-06-04 13:17:18*** Init system aborted. *** Init system aborted. 2019-06-04 13:17:18*** Killing all processes... *** Killing all processes... 2019-06-04 13:17:17Jun 4 11:17:17 ip-10-0-10-90 syslog-ng[14]: syslog-ng shutting down; version='3.13.2' Jun 4 11:17:17 ip-10-0-10-90 syslog-ng[14]: syslog-ng shutting down; version='3.13.2' 2019-06-04 13:17:17*** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown... *** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown... 2019-06-04 13:17:17*** Shutting down runit daemon (PID 23)... *** Shutting down runit daemon (PID 23)... 2019-06-04 13:17:01Jun 4 11:17:01 ip-10-0-10-90 CRON[2438]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly) Jun 4 11:17:01 ip-10-0-10-90 CRON[2438]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly) 2019-06-04 13:14:44ok: run: /etc/service/nginx-log-forwarder: (pid 32) 1s ok: run: /etc/service/nginx-log-forwarder: (pid 32) 1s 2019-06-04 13:14:42Jun 4 11:14:42 ip-10-0-10-90 cron[30]: (CRON) INFO (Running @reboot jobs) 2019-06-04 13:14:42Jun 4 11:14:42 ip-10-0-10-90 cron[30]: (CRON) INFO (pidfile fd = 3) 2019-06-04 13:14:42*** Runit started as PID 23 2019-06-04 13:14:42*** Booting runit daemon... 2019-06-04 13:14:42*** Running /etc/my_init.d/30_presetup_nginx.sh... 2019-06-04 13:14:41Jun 4 11:14:41 ip-10-0-10-90 syslog-ng[14]: syslog-ng starting up; version='3.13.2' Jun 4 11:14:41 ip-10-0-10-90 syslog-ng[14]: syslog-ng starting up; version='3.13.2' 2019-06-04 13:14:41*** Running /etc/my_init.d/10_syslog-ng.init... *** Running /etc/my_init.d/10_syslog-ng.init... 2019-06-04 13:14:41*** Running /etc/my_init.d/00_regen_ssh_host_keys.sh... *** Running /etc/my_init.d/00_regen_ssh_host_keys.sh... ``` The DB is up and running and the credentials are correct ( I get an error message in the DB logs when I try with invalid credentials). The web page says "We're sorry, but something went wrong. The issue has been logged for investigation. Please try again later." I'm pretty clueless what to do to be honest, any suggestions?

uglyog
2019-06-04 11:33
@kristofer.landgren try to work out what has changed since it was last running

yousafn
2019-06-04 13:34
Try running with log level of debug to give you a bit more info :) check the docs for how to set it

bheemreddy181
2019-06-04 14:03
Why does provider needs to make a matching branch name when consumer creates a pull request then provider master build is invoken where I pass consumer tag name which should be verified as path parameter

kristofer.landgren
2019-06-04 14:39
I have this set already: PACT_BROKER_LOG_LEVEL DEBUG

rob.clarken
2019-06-04 22:47
has joined #pact-broker

kristofer.landgren
2019-06-05 05:25
I believe it was a problem when i changed my container image from dius/pact-broker to pactfoundation/pact-broker . I have reverted to an old DB snapshot and dius/pact-broker image and it is working now.

bethskurrie
2019-06-05 05:26
@kristofer.landgren the default port has changed from 80 to 9292 - this might have meant that your health check and routing were looking at the wrong port

kristofer.landgren
2019-06-05 05:36
@bethskurrie Sounds likely. I'll have to give it a go later on. Thanks

kristofer.landgren
2019-06-05 06:45
@bethskurrie You were right. I'll probably have to read instructions more carefully next time. I just read "so you should just be able to switch from dius/pact-broker to pactfoundation/pact-broker" and ran with it :slightly_smiling_face:

bethskurrie
2019-06-05 06:46
That was my bad - I should have noted the port change.

kristofer.landgren
2019-06-05 06:47
No worries, thanks for the support!

borsuk.artem034
2019-06-05 07:49
Hi, as I understand dius/pact-broker will not be supported? And should move to pactfoundation/pact-broker?

uglyog
2019-06-05 07:54
dius/pact-broker is the old image based on Fusion Passenger. pactfoundation/pact-broker is the newer image based on Puma. We think the Puma one is better, but will still have the old one around in case someone needs a Fusion Passenger based image.

uglyog
2019-06-05 07:54
But hopefully the Puma one works for everyone and we can deprecate the other one

bethskurrie
2019-06-05 07:57
@borsuk.artem034 I'm planning on keeping the Dius one up to date for a while.

borsuk.artem034
2019-06-05 07:58
Thanks, I will try new image

pltran875
2019-06-05 10:33
Is this the hosted public beta solution?

bethskurrie
2019-06-05 11:15
Different @pltran875

bethskurrie
2019-06-05 11:15
The public beta is now http://pactflow.io

bethskurrie
2019-06-05 11:17
We are now offering paid plans, with extra features on top of the OSS codebase, like social login, better UI, auth tokens etc.

steveland
2019-06-06 15:11
has joined #pact-broker

richard.jones
2019-06-06 23:54
I?m trying to use the HAL interface to submit tags to our broker, but the `pb:tag-version` link is not marked `templated` so the hal navigator doesn?t let me template in the tag. Is this a bug that?s been fixed, or should I file a new bug?

richard.jones
2019-06-07 00:51
Also, I?m trying to figure out how the Ruby cli?s `--consumer-version-tag` ability to be specified multiple times works. I can see the broker has a `latest-provider-pacts-with-tag` endpoint which I was intending to use until I noticed the multiple times caveat. AFAICT that endpoint does not accept multiple tags.

bethskurrie
2019-06-07 00:51
It makes the tag request multiple times

bethskurrie
2019-06-07 00:53
Also, you need to tag the version BEFORE you publish the pact

bethskurrie
2019-06-07 00:53
so that relation is actually useless

bethskurrie
2019-06-07 00:54
What you need to do is get the pacticipant, and then call the `pb:version-tag` relation.

bethskurrie
2019-06-07 00:56
though having said that, there is no relation in the index to get the pacticipant :stuck_out_tongue:

bethskurrie
2019-06-07 00:56
I should add that

richard.jones
2019-06-07 00:56
hmm, I thought I saw docs that said you tag after submitting the pact

bethskurrie
2019-06-07 00:56
nope - where was that

bethskurrie
2019-06-07 00:57
the tag needs to be there beofre you publish, so that when the webhook fires, the right tags are in place.

richard.jones
2019-06-07 00:57
I?ll try to see where I might?ve seen that. But yeah, for a new pacticipant, that tag operation is going to break, yes?

bethskurrie
2019-06-07 00:57
It auto creates the pacticipant if it doesn't exist

richard.jones
2019-06-07 00:57
okie

bethskurrie
2019-06-07 00:57
the tag request.

bethskurrie
2019-06-07 00:57
like the pact publish auto creates the consumer/provider

bethskurrie
2019-06-07 00:58
it's designed like that because that's the way it gets used.

richard.jones
2019-06-07 01:02
quick question while I?ve got you - what?s the set operation (union or intersection) for multiple `-consumer-version-tag` - I couldn?t find it in the docs

bethskurrie
2019-06-07 01:02
for verification?

richard.jones
2019-06-07 01:02
yeah

bethskurrie
2019-06-07 01:02
you get both

bethskurrie
2019-06-07 01:02
but that logic will be all done for you by the new "pacts for verification" endpoint that is coming soon

bethskurrie
2019-06-07 01:03
I'm getting ron to test it out in a few days with pact jvm

bethskurrie
2019-06-07 01:04
Have a think about how you might run a pact verification test that does not actually fail the build if it fails execution.

bethskurrie
2019-06-07 01:06
Here's an example of the workflow for a pact with the new "pending" feature https://github.com/pact-foundation/pact_broker/blob/feat/verifiable-pacts/spec/features/pending_pacts_spec.rb

bethskurrie
2019-06-07 01:08
The URL to fetch the list of pacts for verification will be "/pacts/provider/Bar/for-verification" and you'll provide a list of consumer version selectors and a list of provider version tags, and the broker will work out which pacts are "pending" for the given provider tags.

bethskurrie
2019-06-07 01:10
I'll do some better implementation notes once I've validated the design with Ron and pact jvm

richard.jones
2019-06-07 01:14
I?m just re-reading the ?pending? blog post in light of what I?ve learned about tagging in the last few days and I?m now a little confused. There seems to be some fuzziness around pending being a tag, and there?s a `verificationProperties` in the code you posted above, and provider version tags are new to me, I thought tags were only on consumer pact versions.

bethskurrie
2019-06-07 01:14
tags are for everyone!

richard.jones
2019-06-07 01:14
I think I need to do a bunch more reading about tagging, I?m clearly not getting something.

bethskurrie
2019-06-07 01:14
Ok, I have a meeting now, but we can chat later

richard.jones
2019-06-07 04:50
@bethskurrie I?ve been poking around the API some more, and I?m just limiting myself to getting the tagging correct for now, and cleaning up some other things where we?ve got hard-coded URLs. I?m trying to discover the HAL path to get to a pacticipant. I know ?pb:pacticipants? at the root will give me a list of them all, which I can navigate to get a single one, but it?s very slow :slightly_smiling_face: I can also use ?pb:latest-version? and then follow its ?pb:pacticipant? link to get there. I can?t see a more direct link though, am I just missing it? :slightly_smiling_face:

bethskurrie
2019-06-07 07:13
No, I only just realised it wasn't there either @richard.jones

bethskurrie
2019-06-07 07:14
I've just added a pb:pacticipant relation to the index.

bethskurrie
2019-06-07 07:15
What I've done when I have existing client code, and a relation that I've only just added is that I use the relation if it exists (which allows the API to evolved without breaking the client) but then provide a handcoded backup url if the relation does not exist. This should be safe, as you know that if the relation doesn't exist, it's a version of the broker that uses the URL that you handcoded.

bethskurrie
2019-06-07 07:16
I've just added ``` "pb:pacticipant-version-tag" : { "href": "https://broker/pacticipants/{pacticipant}/versions/{version}/tags/{tag}", "title": "Get, create or delete a tag for a pacticipant version", "templated" : true } ``` so you can go straight form the index to tagging a pacticipant version without having to go via the pacticipant.

bethskurrie
2019-06-07 07:18
I've just put that relation out in `v2.33.0`

bethskurrie
2019-06-07 07:18
you'll be able to use that for tagging provider versions as well.

hboddupalli
2019-06-07 21:34
has joined #pact-broker

davidmolinero.com
2019-06-08 07:59
has joined #pact-broker

davidmolinero.com
2019-06-08 07:59
Hello :slightly_smiling_face:

davidmolinero.com
2019-06-08 08:00
Is anyone using the pact-broker on http://pactflow.io experiencing issues with the hooks?

kong
2019-06-08 08:14
what kind of issues are you experiencing @davidmolinero.com?

davidmolinero.com
2019-06-08 08:26
It seems that are not been triggered, and I can?t see anything in the logs

davidmolinero.com
2019-06-08 08:26
I?ve just done a test in a local broker and I am not experiencing the same issues

matt.fellows
2019-06-08 11:30
Have you looked at the webhook logs to see if they tell you anything?

matt.fellows
2019-06-08 11:31
We?re not aware of issues on the platform, but we?d be happy to investigate:

davidmolinero.com
2019-06-09 07:50
Thanks, @kong has already taken a look at it

davidmolinero.com
2019-06-09 07:50
Everything seems to be working well for me again

thomas.heilbronner
2019-06-09 16:28
Exactly the feature I?m looking for. We use the same user/token across projects for calls to jenkins. I want to use it for - *jenkins_base_url* (public) - *jenkins_user* (public/secret) - *jenkins_token* (secret)

thomas.heilbronner
2019-06-09 16:29
having this in a single place would really help in case we have to switch the token or user

n.chachampis
2019-06-11 06:49
has joined #pact-broker

s1apped
2019-06-11 10:46
Hi. Does anyone have issue with contract_content_changed webhook event? :disappointed:

bethskurrie
2019-06-11 10:52
Yes @s1apped we discovered an issue over the weekend with webhooks not firing. They're fixed now though.

bethskurrie
2019-06-11 10:53
That's if you're talking about http://pactflow.io.

bethskurrie
2019-06-11 10:54
If you're running your own instance, then there are no issues that I'm aware of in the docker image.

s1apped
2019-06-11 10:56
Well I have problem that it's firing without contract change. What should trigger this event? Difference in contract (published json) or commit?

bethskurrie
2019-06-11 10:56
Which broker are you running?

bethskurrie
2019-06-11 10:57
Your own, or pactflow?

bethskurrie
2019-06-11 10:57
The things that trigger it are content changing compared to any of the previous pact versions with the same tag.

bethskurrie
2019-06-11 10:58
Or a brand new tag.

bethskurrie
2019-06-11 10:59
There's logging that will tell you why it's triggered, but I need to know where you're running your broker before I can tell you how to access it

s1apped
2019-06-11 10:59
Docker

bethskurrie
2019-06-11 11:01
If you're reasonably up to date, and you turn the log level up to debug, you'll see some logs that tell you why the webhook got triggered.

s1apped
2019-06-11 11:03
So if content didn't change but every published pact is tagged with new commit hash it will

s1apped
2019-06-11 11:03
trigger this hook

bethskurrie
2019-06-11 11:03
it will not trigger if the consumer version changes

bethskurrie
2019-06-11 11:04
but if you're tagging with the git sha, then yes, that will trigger it.

bethskurrie
2019-06-11 11:04
you wouldn't typically tag with a git sha

bethskurrie
2019-06-11 11:04
you'd tag with the git branch

bethskurrie
2019-06-11 11:04
the git sha would be the consumer version number.

bethskurrie
2019-06-11 11:05
It goes through all the tags that have been applied to the consumer version, and it checks if the content has changed since the previous latest pact for that tag.

bethskurrie
2019-06-11 11:07
Ok, to see the logging you'll need 2.31.0 or later.

s1apped
2019-06-11 11:07
you are totally correct

s1apped
2019-06-11 11:07
this is the way i have it setup

s1apped
2019-06-11 11:07
version = git sha

s1apped
2019-06-11 11:07
and tag = branch name

s1apped
2019-06-11 11:11
Webhook triggered for the following reasons: first time untagged pact published

bethskurrie
2019-06-11 11:12
Hm

bethskurrie
2019-06-11 11:12
I think someone raised a similar issue

bethskurrie
2019-06-11 11:13
I haven't had a chance to look into it.

bethskurrie
2019-06-11 11:15
What lib are you publishing with?

bethskurrie
2019-06-11 11:15
I wonder if the tag is being applied after the pact is published

s1apped
2019-06-11 11:16
I'm using java, junit and gradle

s1apped
2019-06-11 11:17
I see everything in UI

bethskurrie
2019-06-11 11:17
Could you check your logs and see what the order is?

s1apped
2019-06-11 11:19
looking into it

antonello
2019-06-11 11:24
@bethskurrie What they will probably end up doing is to keep the idempotence of their flip script is to always delete the tag from the version they are flipping from and add it to the version they?re flipping to.

antonello
2019-06-11 11:24
Also, they?re writing a lightweight client for the pact broker in python. I?m encouraging them to open source it.

bethskurrie
2019-06-11 11:25
Please make sure they're using the hal relations then.

bethskurrie
2019-06-11 11:25
I don't guarantee the urls won't change. But the hal relations are fixed.

bethskurrie
2019-06-11 11:26
Also, please have them write a pact for me.

bethskurrie
2019-06-11 11:26
I generally prefer people to use the existing clients where possible, because keeping everything up to date is much easier when there are fewer clients.

bethskurrie
2019-06-11 11:27
Keeping all the libraries up to date with maintainers scattered around the world is like herding cats :joy:

antonello
2019-06-11 11:27
The main reason is that they would like to avoid having a dependence on ruby on their build servers.

bethskurrie
2019-06-11 11:28
Use the docker image, no ruby

bethskurrie
2019-06-11 11:29
Also, the pact ruby standalone has ruby bundled with it - also no ruby required on the client machine.


s1apped
2019-06-11 11:31
should I look for anything specific?

bethskurrie
2019-06-11 11:31
the order of the HTTP logs

bethskurrie
2019-06-11 11:32
is the tag call before or after the pact call?

bethskurrie
2019-06-11 11:32
the tag call will end in `/tag/TAG`

bethskurrie
2019-06-11 11:32
They'll both be PUTs

antonello
2019-06-11 11:32
I had not looked into it all, thankfully I?ve mentioned it to you!

bethskurrie
2019-06-11 11:33
this is a pact publication line `127.0.0.1 - - [11/Jun/2019:20:40:41 +1000] "PUT /pacts/provider/Bar/consumer/Foo/version/1 HTTP/1.1" 201 2926 0.0285`

bethskurrie
2019-06-11 11:33
`PUT /pacticipants/Foo/versions/1/tags/master` is a tagging line


bethskurrie
2019-06-11 11:34
I love people to contribute, but new implementations end up making more work for me. People who contribute to existing implementations make less work for me!

antonello
2019-06-11 11:37
I?m with you!

bethskurrie
2019-06-11 11:37
I think this is the issue


bethskurrie
2019-06-11 11:37
I'll try and have a look at it as soon as I can

bethskurrie
2019-06-11 11:37
I have to go now.

bethskurrie
2019-06-11 11:38
Let me know if you can work out which order the tag and pact calls are made in.

s1apped
2019-06-11 12:05
I would be very gratefull. I don't see anything like what you described.

s1apped
2019-06-11 12:14
aside from queries these are the only logs I see

s1apped
2019-06-11 12:14
Upserting version 828c719d13691b2259ec28pgc4ccff2dd02daaf7 for pacticipant_id=4 Creating new pact publication with params {:consumer_name=>"test1", :provider_name=>"test2", :revision_number=>nil, :consumer_version_number=>"828c719d13691b2259ec28pgc4ccff2dd02daaf7", :pact_version_sha=>nil, :consumer_name_in_pact=>"test1", :provider_name_in_pact=>"test2"} No webhook found for consumer "test1" and provider "test2" Webhook triggered for the following reasons: first time untagged pact published

aniela.cole
2019-06-11 23:22
has joined #pact-broker

aniela.cole
2019-06-11 23:30
Hi. Does anyone have issue publishing pacts to pactflow? :disappointed: My code: ``` const pact = require('@pact-foundation/pact-node'); const path = require('path'); const opts = { pactFilesOrDirs: [path.resolve(__dirname, '../tests/pact/pacts/')], pactBroker: 'https://moveteam1pactbroker.pact.dius.com.au/', pactBrokerToken: 'Bearer READ WRITE TOKEN', tags: ['test'], consumerVersion: require('../package').version, }; pact.publishPacts(opts).then(() => { console.log('Pact contract publishing complete!'); }) .catch((e) => { console.log('Pact contract publishing failed: ', e); });``` Error: `Could not publish pact: Failed to tag version 1.0.0 of Magneto due to error: PactBroker::Client::Error - Authentication failed}`

matt.fellows
2019-06-11 23:31
You don't need to add the "bearer" bit

matt.fellows
2019-06-11 23:32
Just the token

aniela.cole
2019-06-11 23:33
Hi Matt, I tried that as well, it doesn't work

bethskurrie
2019-06-11 23:41
I will PM you @aniela.cole

aniela.cole
2019-06-11 23:41
thanks!

richard.jones
2019-06-12 01:05
Would it be possible to have the broker remember a user?s preference in the Matrix for ?Show latest result for each consumer version/provider?? We find that view to be a less confusing default view than the ?Show all results? view.

bethskurrie
2019-06-12 01:06
We could put that in a cookie

richard.jones
2019-06-12 01:06
yes please :slightly_smiling_face: [I just had a half hour conversation with some folks explaining why the default Matrix was displaying ?all these confusing results?]

richard.jones
2019-06-12 01:08
(I only just discovered while explaining that to them that there?s a tooltip over ?older? Pact Published values)

bethskurrie
2019-06-12 01:08
Maybe that's best as the default view?

richard.jones
2019-06-12 01:08
I think so, but my experience might not be the same as others?

bethskurrie
2019-06-12 01:08
I'm not sure what the main use case is for people looking at the matrix,

richard.jones
2019-06-12 01:09
We often end up there trying to figure out a failure of a feature branch, and the Matrix is the only way to see all ?active? consumer versions easily

bethskurrie
2019-06-12 01:12
so, if the default view was to show the latest versions for all of the tags, would that be more useful?

richard.jones
2019-06-12 01:12
sure, if we were using tags :sweat_smile: :sweat:

bethskurrie
2019-06-12 01:12
ah

bethskurrie
2019-06-12 01:12
how do you know which are your branch builds?

bethskurrie
2019-06-12 01:13
and how do you stop your branch builds failing your provider builds?

bethskurrie
2019-06-12 01:13
if you're just pulling in the "latest" each time?

richard.jones
2019-06-12 01:18
They?re *cough* all branch builds in *this* broker (as opposed to the other broker, which just has master branch). They *do* currently cause provider builds to fail (much to the ire of the ?no failing builds? brigade). And yeah, we?re pulling in ?latest? each time (another thing I need to address in our webhook usage). I?m currently writing up a plan to address our current pact workflow problems, which starts with ?implement tagging?, has several interim steps, and ends with ?shut down the unnecessary second broker?. Once I have written the plan, then I need to get actual buy-in from all the people, which is going to be the hard part :sweat_smile:

bethskurrie
2019-06-12 01:22
You guys are killing me :rolling_on_the_floor_laughing:

richard.jones
2019-06-12 01:22
yah, sorry :sweat_smile:

bethskurrie
2019-06-12 01:23
You're feeling all the pain of using contracts, and not using the features that alleviate it!

richard.jones
2019-06-12 01:23
just so many things not understood correctly right at the start resulting in a bad implementation that?s really hard to fix now

bethskurrie
2019-06-12 01:23
Your team will love the new pending pacts feature. No more consumers breaking provider builds.

richard.jones
2019-06-12 01:23
3 years or so of accumulated pact usage *done the wrong way* :smile:

bethskurrie
2019-06-12 01:24
Could you just gorilla hack in the tags in a couple of codebases... don't use them, just add them.

richard.jones
2019-06-12 01:24
yep, that?s basically step 1

bethskurrie
2019-06-12 01:24
Baby steps...

bethskurrie
2019-06-12 01:26
Have you guys read this recently? https://docs.pact.io/best_practices/pact_nirvana


richard.jones
2019-06-12 01:27
Yep, I?m referring to that in my plan :slightly_smiling_face:

matt.fellows
2019-06-12 01:34
Sorry I was at a meetup this morning @aniela.cole. I hear your problem is sorted, thanks Beth!

s1apped
2019-06-12 07:00
Hi @bethskurrie don't know if you have seen this but I wasn't able to find pact calls in logs.. wondering if I'm missing something?


s1apped
2019-06-12 07:06
I did and looks like something has changed since can't find

s1apped
2019-06-12 07:06
cat /var/log/nginx/access.log

s1apped
2019-06-12 07:09
cat/var/log is empty

bethskurrie
2019-06-12 07:19
hm.

bethskurrie
2019-06-12 07:19
oh, you're using the puma one aren't you?


bethskurrie
2019-06-12 07:30
hm, I don't know where the http logs are if they're not in stdout then

bethskurrie
2019-06-12 07:30
No worries, I will investigate anyway.

s1apped
2019-06-12 07:31
I thought thye might be in some other place but didn't have luck finding them :confused:

vitaliy.grigoruk
2019-06-12 08:51
are there any details about ?pending? pacts feature?

enrique
2019-06-12 15:03
has joined #pact-broker

mounikachirasani
2019-06-12 15:39
has joined #pact-broker

aniela.cole
2019-06-12 18:11
yes, thanks!

bheemreddy181
2019-06-12 23:36
I created a webhook on dius hosted pact broker using pb:create but the webhook didn?t get saved automatically is there something I am missing while creating a webhook ? @bethskurrie @matt.fellows

bethskurrie
2019-06-12 23:36
There shouldn't be! Let me try it.

bheemreddy181
2019-06-12 23:37
Do the HAL browser should show the webhook created successfully

bethskurrie
2019-06-12 23:37
yes, it will return the body of the webhook


bethskurrie
2019-06-12 23:38
I am actually working on a webhooks UI for pactflow as we speak.

bethskurrie
2019-06-12 23:38
I hope to have it out next week.

bethskurrie
2019-06-12 23:39
Did you do a POST or a GET?

bethskurrie
2019-06-12 23:40
You have to click the 'NON-GET' button.

bheemreddy181
2019-06-12 23:47
NOn GET

bheemreddy181
2019-06-12 23:47
I did the same

bheemreddy181
2019-06-12 23:49
It actually trigger my provider Travis build but it didn?t get saved

bethskurrie
2019-06-12 23:49
Unless I can see your screen, I'm not sure how to help you. You could take screenshots and PM them to me?

bheemreddy181
2019-06-13 01:40
Will do that


s1apped
2019-06-13 06:39
@bethskurrie thank you for investigating. Is there a change it will be fixed in near future?

bethskurrie
2019-06-13 06:42
Hopefully Ron can get the fix out soon. Watch that issue so you get notified when it's closed.

s1apped
2019-06-13 06:51
Sounds good. Thanks!

bheemreddy181
2019-06-13 14:38
Details are sent across

thirumal.net
2019-06-13 18:27
Hi @beth @matt.fellows @yousafn i am looking for consumer and provider naming convention guidelines for pact broker. i would like to publish naming comvention guidelines to the internal teams since every team is following their own way( different teams are using different names like consumer_projectname_Client , service-name , servicename_provider ..etc. ) could you please help me where can i find out more details about Pact broker Guidelines on naming conventions for consumer and provider names ?

matt.fellows
2019-06-14 01:00
we don?t have any naming conventions

richard.jones
2019-06-14 01:20
Would it be possible to include a mapping of verification status to bitbucket status names (like the github names) in the broker?s `provider_verification_published` webhook? (edit) Would a PR be accepted? (edit) I?ve written one, just need to install all the tooling to test it :sweat_smile:

richard.jones
2019-06-14 02:35
My mac just kernel panicked running `ruby-install 2.4.6` :sweat_smile:

richard.jones
2019-06-14 02:38
`chruby` complains `chruby: unknown Ruby: 2.4.0` when I cd into the pact-broker dir now. Any objections to me changing the `.ruby-version` to just `2.4`? I don?t really know what the ramifications of that might be though.

bethskurrie
2019-06-14 02:40
:shrug::skin-tone-3:

bethskurrie
2019-06-14 02:41
2.5 should be fine

bethskurrie
2019-06-14 02:41
i think we run it on 2.5 anyway

bethskurrie
2019-06-14 02:46
Totally @richard.jones

bethskurrie
2019-06-14 02:47
I should make a docker image for running the tests

richard.jones
2019-06-14 02:47
hmm, ok :slightly_smiling_face:

richard.jones
2019-06-14 02:49
I?m trying to figure out how to run the test suite, but I can?t see the test command in either DEVELOPER_* doc. Any hints?

bethskurrie
2019-06-14 02:49
lolz

bethskurrie
2019-06-14 02:50
bundle exec rake

richard.jones
2019-06-14 02:50
kthx

bethskurrie
2019-06-14 02:50
i'll add that

bethskurrie
2019-06-14 02:50
hint - look at the travis.yml

richard.jones
2019-06-14 02:54
I got a couple of failures, related to database connection and tables missing, so I?m going to ignore those and submit the PR


bethskurrie
2019-06-14 02:55
yeah, should be fine

bethskurrie
2019-06-14 02:55
a build will run on Travis anyway

neonmd
2019-06-14 09:40
has joined #pact-broker

oswald.quek
2019-06-14 10:00
for some reason the pact broker has just stopped tagging pacts when my CI performs `curl -H 'Content-Type: application/json' -X PUT -k --user ${PACT_BROKER_USERNAME}:${PACT_BROKER_PASSWORD} https://<url>/pacticipants/${serviceName}/versions/${version}/tags/${tag}`

oswald.quek
2019-06-14 10:12
hmm nevermind

taranovskyi.anton
2019-06-14 13:27
has joined #pact-broker

taranovskyi.anton
2019-06-14 14:49
hi guys. I am facing issue while updating pact file for message verification - I am publishing new version of pact file with new consumer version and new tag, but pact-broker just add new version of message to previous pact file

matt.fellows
2019-06-14 23:47
Which language are you using @taranovskyi.anton? The issue would be unrelated to the broker, it would be merged into the existing pact file prior to publishing

bheemreddy181
2019-06-16 04:20
@bethskurrie if you are around couple of queries

bheemreddy181
2019-06-16 04:21
```pact_broker_base_url 'https://bheemreddy.pact.dius.com.au/pacts/provider/PGS/consumer/Portfolio/', {username: '----', password: '-----'} consumer_version_tags [{name: ENV['TRAVIS_BRANCH'], all: false, fallback: 'master'}] ```

bheemreddy181
2019-06-16 04:22
should pact_url contain latest at the end ?

bheemreddy181
2019-06-16 13:30
Any idea how can I pass query params for travis API for triggerring a build , i get the below response

bheemreddy181
2019-06-16 13:30
```"@warnings": [ { "@type": "warning", "message": "query parameter pactConsumerTags not safelisted, ignored", "warning_type": "ignored_parameter", "parameter": "pactConsumerTags" } ]```

bheemreddy181
2019-06-16 13:34
And when i trigger the the webhook from the broker browser , i get the below error , is this because the endpoint shoould be whitelisted to trigger the builid ?

bheemreddy181
2019-06-16 13:34
```SSL_connect returned=1 errno=0 state=error: certificate verify failed```

bethskurrie
2019-06-16 21:41
@bheemreddy181 no it's because you have a self signed certificate for your CI

bethskurrie
2019-06-16 21:41
You'll need to load the certificate into the broker. Have a look at the webhook or configuration docs for how to do this.

bethskurrie
2019-06-16 21:42
The first error is coming from your own CI instance. It looks like you need to whitelist the incoming parameters.

bethskurrie
2019-06-16 21:42
You'll need to read the Travis documentation for working out how to whitelist a parameter.

bethskurrie
2019-06-16 21:44
@taranovskyi.anton can you please provide an executable example to demonstrate your issue please?


bethskurrie
2019-06-16 21:45
You can call it whatever you like @thirumal.net. I'd recommend using whatever your repository name is, however.

bethskurrie
2019-06-16 21:46
It means you can create global webhooks where ${consumerName} or ${providerName} can be substituted in to the webhook body.

bheemreddy181
2019-06-16 21:51
The broker is hosted by DIUS ( by you people ) can you load the certificate for me

bethskurrie
2019-06-16 21:51
@s1apped Please upgrade to the latest pact-jvm version https://github.com/DiUS/pact-jvm/issues/892#issuecomment-502343767

bheemreddy181
2019-06-16 21:52
@bethskurrie ^

bethskurrie
2019-06-16 23:34
Yes, email it to with the name of your broker.

james.hattersley-dyke
2019-06-17 09:03
Hi, does anyone know of any guides to set up the broker on ECS?

matt.fellows
2019-06-17 09:34
Not that I?m aware of sorry

yousafn
2019-06-17 10:10
I run it on ecs at work, we use cloud formation templates to create our rds database, a cluster and a service. In the service we add in env vars for our database/login credentials and health check. We also use an application load balancer. I would really use someone who familiar with AWS to set it up. I looked at open sourcing cloud formation templates but as each workplace has different security profiles, there is no universal solution. I did post up some info before - here is a cut and paste Regarding running on an ELB, ideally use cloud formation templates. You want to clear a cluster with a network stack including vpcs, route 53 for dns and roles with ecs access to execute the containers, then service template?s to run fargate ecs and rds tasks. Deploy via AWS-cli to allow you to pass in environment variables at runtime into the docker container for the pact broker to pick up. Additionally you can store your env vars in amazons parameter store This is a good place to start for the CF templates. You can deploy your db with CF templates too https://github.com/nathanpeck/aws-cloudformation-fargate#private-subnet-public-load-balancer Unfortunately I can?t share my work CF templates. Best of luck with playing with AWS but please do be mindful that you don?t want to leave your resources insecure for too long. Feel free to drop me a pm if you want help with any specifics.

james.hattersley-dyke
2019-06-17 10:53
cheers! I eventually sorted it. I'm running the tasks on Fargate with a small RDS instance - will ultimately create CF templates as that's the way we want to do things. Secrets are all stored in secrets manager too.

james.hattersley-dyke
2019-06-17 10:54
It was my security groups which were the problem. I was using IP addresses for each one when I should (as a colleague pointed out) be referencing other SGs

yousafn
2019-06-17 11:03
Spot on fella! We just recently switched to the new puma based image too which is running really well!

agarwalatrisha1212
2019-06-18 03:18
has joined #pact-broker

taranovskyi.anton
2019-06-18 07:36
c# I am using pact .net package build from `message-pact` branch

matt.fellows
2019-06-18 07:45
I read his problem that it?s appending the content to the same pact file locally (i.e. the `merge` mode, instead of `overwrite`)

matt.fellows
2019-06-18 07:45
thanks

taranovskyi.anton
2019-06-18 07:47
@matt.fellows can share link to pact-broker server

matt.fellows
2019-06-18 07:47
?

matt.fellows
2019-06-18 07:47
Sorry not sure what you mean there?

taranovskyi.anton
2019-06-18 07:48
so u can see how it looks in pact-broker application

taranovskyi.anton
2019-06-18 09:15
@bethskurrie agree to @matt.fellows message, it is reproducible for local pact json file looks like issue on Pact .Net library side

bethskurrie
2019-06-18 09:15
Ah right

bethskurrie
2019-06-18 09:17
So, the CLI does not know if the pact file is there because it's mid way though a test run or if it's left over from the previous test

bethskurrie
2019-06-18 09:18
As the author of the native code, you'll have to find the right point before the test to delete any existing file

bethskurrie
2019-06-18 09:18
The before all hook in your test suite, whatever that looks like.

taranovskyi.anton
2019-06-18 09:22
sure, will take a look however, there is some existing verification for file existing https://github.com/pact-foundation/pact-net/blob/message-pact/PactNet/Builders/MessagePactBuilder.cs#L86 will double check thanks for a help

matt.fellows
2019-06-18 09:55
I normally wipe the pacts dir before running the tests

james.hattersley-dyke
2019-06-19 09:32
Hi, just wanted to ask if this is a viable solution to running provider verification or if I've gone totally left field with this one... So, our jenkins instances aren't publicly accessible, so webhooks aren't an option without some fancy aws network foo (which I don't posses) - What I did do though instead of a webhook, is have the consumer build kick off another generic build job which takes the repo and branch of the provider you want to run... it has the added benefit that the consumer build will pass / fail based on the provider verification. Is this good / bad? It's the only way I could think of to automatically kick off provider verification job: ``` build job: 'pact-verify-provider-gradle', parameters: [ string(name: 'GIT_REPO', value: 'git@bitbucket.AcmeCorp/product-command.git'), string(name: 'GIT_BRANCH', value: 'pact-sqs') ] ```

iruben91
2019-06-19 14:58
In terms of Pact Broker setup, how critical is the database resilience? Meaning, if by accident a data loss was to happen, how important would having a form of backup be?

bxj231
2019-06-19 16:52
has joined #pact-broker

james.hattersley-dyke
2019-06-20 07:16
does anyone have any feedback on this approach to provider verification please?

abubics
2019-06-20 07:22
I think we've set it up kinda like that when our broker/CI couldn't both see each other

abubics
2019-06-20 07:22
it is less elegant, but still gets similar value :ok_hand:

james.hattersley-dyke
2019-06-20 07:51
cool, yeah - I couldn't think of a way around the whole not being able to see each other. I thought it was quite inventive - just wasn't 100% sure it was valid :slightly_smiling_face:

james.reynolds
2019-06-20 15:56
has joined #pact-broker

jemmawells
2019-06-21 16:07
has joined #pact-broker

mui_ume
2019-06-24 11:50
has joined #pact-broker

mui_ume
2019-06-24 11:56
when I run npm run publish:pact > tlstellaclientapp@0.0.1 publish:pact /Users/tohlaymui/Desktop/tl_stella-client_app > node ./pact/publish.js /Users/tohlaymui/Desktop/tl_stella-client_app/pact/publish.js:6 pactFilesOrDirs: [path.resolve(process.cwd(), 'pacts')], ^

mui_ume
2019-06-24 11:56
my pact/publish.js content: ```const { publisher } = require('@pact-foundation/pact-node'); const { path } = require('path'); const opts = { providerBaseUrl: 'http://localhost:8080', pactFilesOrDirs: [path.resolve(process.cwd(), 'pacts')], pactBroker: 'https://localhost:3000', consumerVersion: '2.0.0', }; publisher.publishPacts(opts).then(() => console.log('Pacts successfully published')); ```


mui_ume
2019-06-24 11:59
my node version node --version v10.15.1

mui_ume
2019-06-24 12:30
can someone explain this step here at https://github.com/pact-foundation/pact_broker The generated pact is then published to the Pact Broker. Most Pact libraries will make a task available for you to do this easily, however, at its simplest, it is a PUT to a resource that specifies the consumer name and application version, and the provider name. eg http://my-pact-broker/pacts/provider/Animal%20Service/consumer/Zoo%20App/version/1.0.0 (Note that you are specifying the consumer application version in the URL, not the pact version. The broker will take care of versioning the pact behind the scenes when its content changes. It is expected that the consumer application version will increment with every CI build.)

matt.fellows
2019-06-24 12:59
What's the actual error Lay?

matt.fellows
2019-06-24 22:43
(you need to be able to show the errors to others for help). in any case, I?m pretty sure it?s because it should be `pactUrls`

antonello
2019-06-26 06:29
Morning! Any reason why the latest image is only tagged as `edge`, without any semantic version? https://hub.docker.com/r/pactfoundation/pact-broker/tags

antonello
2019-06-26 06:35
Or to rephrase my question in a different way, I?m assuming it?s recommended that we use the ?new? docker image (`pactfoundation`), but the latest semantic version that is published is `2.32.0-2 `, however, the lastest pact broker release is `2.34.0 `

antonello
2019-06-26 09:46
@bethskurrie perhaps you could shed some light before it?s night time in Australia? :blush:

bethskurrie
2019-06-27 01:54
I just haven't released it yet. Will try and do it today.

bethskurrie
2019-06-27 02:18
@antonello 2.34.0-1 is building

bethskurrie
2019-06-27 02:18
there's nothing major in the releases. just little race condition fixes and some new relations in the hal resources.

antonello
2019-06-27 04:59
Thank you!

antonello
2019-06-27 05:42
out of curiosity, is there any way to see which version of the broker you?re running besides checking which image you?re running? something like a version endpoint?

bethskurrie
2019-06-27 05:58
it's in the response header

bethskurrie
2019-06-27 05:58
X-Pact-Broker-Version

antonello
2019-06-27 05:59
:pray:

detert
2019-06-27 14:21
I have a question regarding webhooks. We use feature-branches and I implemented the webhook so that a pact change in a feature-branch of service A triggers the pipeline of the according feature-branch of service B I see several retry for the webhook, if service B does not have that feature-branch. How do you handle that situation? Can I avoid to trigger the webhook, if no feature branch exists?

franklin.huynh
2019-06-27 23:36
Hi @bethskurrie and @matt.fellows could I have a question? do you have any idea of getting the list of services communicating with each other? I want to know how many service integrations haven't covered by contract tests.

bethskurrie
2019-06-27 23:37
Hi @franklin.huynh. You can use the `/integrations` endpoint to get this info.

franklin.huynh
2019-06-27 23:40
thanks @bethskurrie

matt.fellows
2019-06-28 00:05
FYI I spoke to Beth yesterday when we had this conversation Franklin. Were you looking for something more?

bethskurrie
2019-06-28 00:06
I'd just suggested to ask in the public channels so other people could learn.

phall
2019-06-28 19:53
I?m setting up and testing webhooks with the broker. I?ve created a webhook with `"method": "POST"` - and the same is present when I GET the webhook UUID - but when I test this call (by POSTing to the `/webhooks/?/execute` URL, it seems to attempting a GET. I see a 415 response, and no mention of method. Has anyone seen this behaviour?

phall
2019-06-28 20:00
To answer my own question. I had omitted the `application/json` header. I added this, and everything started to work. :confused:

matt.fellows
2019-06-29 04:47
:point_up: any takers? We would _love_ to get more contributors, and this is an easy win! :smile:

bethskurrie
2019-07-01 08:38
It probably should only need the Accept header. I'll have a look at that.

pact.io
2019-07-01 19:04
I currently try to understand how `pact-provider-verifier --publish-verification-results` works with tags. I currently publish the tag according to my feature branch after I published the provider results. Is that correct? Do I need to publish a tag here at all?

detert
2019-07-02 14:29
Alright. I just see at `contract content changed` explains that "One side effect of this is that brand new tags will trigger a pact changed event". Is there any option to avoid that? We work with feature branches and I trigger a master build if a pact changed to ensure compatibility. Every feature branch triggers a master pipeline now. Is that necessary?


detert
2019-07-02 14:51
@antonello Thank you. I don't think so. I want the other pacticipant's master and feature branch pipelines to run. But only if the pact contents really changed

detert
2019-07-02 14:52
As far as I understand: That issue does something else. It restricts a webhook to certain tags

detert
2019-07-02 14:54
My configuration is that every build triggers the master build of the other pacticipant. And every feature branch triggers the feature branch of the other pacticipant. However that is not needed, if nothing changed. Maybe that does not make sence, I just found no better way to revalidate all pact changes

antonello
2019-07-02 15:00
it does make sense, but if the web hooks were restricted to specific tags, you could have (for example) a webhook that always triggers for pact changes with only a master tag (and/or other known tags), but then create a webhook for each feature branch.

detert
2019-07-02 15:02
Well, I added a webhook that always triggers master. And I have a webhook that always triggers a feature-branch. If that feature branch does not exists, that webhook fails or is kind of ignored. That is fine. However I do not understand why the issue should help to avoid triggering a build if in fact nothing changed (only a new tag was added to an existing pact). Maybe I miss something

phall
2019-07-02 15:06
If you are triggering on the `contract_content_changed` event, the docs state ?contract_content_changed: triggered when the content of the contract, or tags applied to the contract have changed since the previous publication? - which is the same behaviour as you?re seeing.

detert
2019-07-02 15:22
Exactly. And I search a possibility that the build is not triggered, if a new tag was applied. Only if the pact content changed

franklin.huynh
2019-07-03 01:58
hi @matt.fellows and @bethskurrie I have a pact between pacticipants and provider verification result has been published. Could you suggest me which API to check if the pact (latest) has been verified?

bethskurrie
2019-07-03 02:00
Yes, use the can I deploy tool

bethskurrie
2019-07-03 02:01
That's exactly what it's designed for.

bethskurrie
2019-07-03 02:01
You'll find some docs for it under the pact broker section of http://docs.pact.io


bethskurrie
2019-07-03 02:06
When you make a new tag, it makes a new pseudo branch

bethskurrie
2019-07-03 02:06
It triggered because the content for the previous version of the tag did not exist.

bethskurrie
2019-07-03 02:08
If you want to get smart about it, have the webhook trigger an intermediate build that works out if the matching provider branch exists or not.

bethskurrie
2019-07-03 02:09
And then triggers the desired branch build.

franklin.huynh
2019-07-03 03:33
Do you have more basic API. I just want to know if that pact has the verified result or not. Like **/pact/version/{version} And I can get the result from that. For example, I want to get these information via API Consumer - Provider - Latest pact verified (Failed/Passed) / Or Null

bethskurrie
2019-07-03 03:39
Can you explain what you're trying to do?

bethskurrie
2019-07-03 03:39
Why is the CLI not useful for you?

bethskurrie
2019-07-03 03:42
This is the command

bethskurrie
2019-07-03 03:42
docker run --rm \ -e PACT_BROKER_BASE_URL \ -e PACT_BROKER_USERNAME \ -e PACT_BROKER_PASSWORD \ pactfoundation/pact-cli:latest \ broker can-i-deploy \ --pacticipant Foo \ --latest

bethskurrie
2019-07-03 03:42
That tells you the verification result of the latest version of Foo

bethskurrie
2019-07-03 03:43
I can give you the underlying query, but this is much easier.


franklin.huynh
2019-07-03 03:43
sure

bethskurrie
2019-07-03 03:43
You can use the docker or grab the CLI from github

bethskurrie
2019-07-03 03:44
If you're not using docker, then you can install the pact ruby standalone (no ruby required)

franklin.huynh
2019-07-03 03:44
let's me explain what I want to do, then maybe you can have any idea

franklin.huynh
2019-07-03 03:47
Let's say I have services (this is outside of pactflow because we haven't written contract test for these services) for example (1) Service A ==> Service B (have contract test) Service C ==> Service B (have contract test) Service A ==> Service C (not have yet) What I want is to get below information from PactFlow (2) Service A ==> Service B (Provider verified passed/failed) Service C ==> Service B (Provider verified passed/failed) Then I will compare (1) and (2), I will know the gap that I should write contract tests

bethskurrie
2019-07-03 03:48
Try the command that I said, it will give you what you want. You can give it multiple names.

bethskurrie
2019-07-03 03:49
Can-I-deploy --pacticipant A --latest --pacticipant B --latest

bethskurrie
2019-07-03 03:49
You can get json output

bethskurrie
2019-07-03 03:50
It will tell you whether each pair's verification is success, failure or missing.

franklin.huynh
2019-07-03 03:54
ah, I see

franklin.huynh
2019-07-03 03:55
we can pass multiple names

franklin.huynh
2019-07-03 03:55
thanks Beth, I'll try it now

bethskurrie
2019-07-03 03:55
If you just pass one, it calculates the integrations for you. If you pass more than one, it just gives you the results that you asked for.

franklin.huynh
2019-07-03 04:11
I tried

franklin.huynh
2019-07-03 04:15
I have a question I passed 2 pacticipant When run can-i-deploy alone, pacticipant 1 is "Computer says yes \o/ " pacticipant 2 is "Computer says no ¯\_(?)_/¯ ....There is no verified pact..." But when I put these pactcicpants together, it says ``` Computer says yes \o/ There are no missing dependencies ```

franklin.huynh
2019-07-03 04:16
is it supposed to say No as the pactcipant 2

franklin.huynh
2019-07-03 04:43
@bethskurrie I suspect it's a bug. Could you take a look or you want me to raise a ticket?

bethskurrie
2019-07-03 05:26
It's not a bug. One is a provider and the other is a consumer.

bethskurrie
2019-07-03 05:26
You can deploy the provider without the consumer, but not that other way around.

detert
2019-07-03 06:06
Is there anything against adding a new event type, which does not trigger with new tags, but only when the content of the pact changes?

bethskurrie
2019-07-03 06:06
Changes compared to what?

detert
2019-07-03 06:07
well, the json file itself

bethskurrie
2019-07-03 06:07
I know, but which previous version would you compare it to?

bethskurrie
2019-07-03 06:09
It's kind of a trick question.

bethskurrie
2019-07-03 06:10
If you just compare to the previous version according to time, ignoring tags, then if you have different branches pushing different content all mixed up, you'll get unpredictable results.

bethskurrie
2019-07-03 06:11
If you say, only trigger when there was already an existing version, and it has changed, then you won't end up triggering a webhook for the very first version.

detert
2019-07-03 06:11
Well. Maybe I misunderstand something fundamentally. I would assume that an event is triggered if the request or the expected response changes. If request and expected response remain the same, nothing should break. Thus I do not understand why a new tag should trigger a webhook. According to https://docs.pact.io/getting_started/versioning_in_the_pact_broker

bethskurrie
2019-07-03 06:12
People rely on the trigger for the first tag, because that's likely the first time a consumer branch has been pushed.

bethskurrie
2019-07-03 06:12
Because it's effectively a new pseudo branch of development.

detert
2019-07-03 06:13
But a new branch, in my case, does not mean that I want to change the contract

bethskurrie
2019-07-03 06:13
If it's already passed it will pass again. What's the issue?

bethskurrie
2019-07-03 06:14
Are your provider verification builds expensive or lengthy?

detert
2019-07-03 06:15
The issue is, that our build pipelines are triggered a lot now. That causes a lot of unnecessary builds. Unfortunatley some of our build pipelines are very slow. That's why I wanna try to avoid it.

bethskurrie
2019-07-03 06:16
Do they just do the verification, or do they run the whole build?

franklin.huynh
2019-07-03 06:16
it's weird.

bethskurrie
2019-07-03 06:17
it shouldn't trigger an entire pipeline. it should just do the verification step.

detert
2019-07-03 06:17
I did run only the verification at first. However I changed that and run unit tests as well currently, to avoid problems that could occur if several branches were merged. Maybe I need to think about that

detert
2019-07-03 06:19
I try to remember what the background was

franklin.huynh
2019-07-03 06:19
I got what you mean. yea, you're right

bethskurrie
2019-07-03 06:19
what you can do is put a can-i-deploy check at the start of the build to see if you've already verified that particular content with the sha you've got.

franklin.huynh
2019-07-03 06:19
thanks @bethskurrie

bethskurrie
2019-07-03 06:19
then just exit 0 if you have.

detert
2019-07-03 06:23
That sounds interesting. I guess that I have to include ${pactbroker.providerVersionNumber} in the webhook and use can-i-deploy with --version then?

bethskurrie
2019-07-03 06:23
no, the consumer number.

bethskurrie
2019-07-03 06:23
you know the provider number - it's whatever you're currently running the build for.

detert
2019-07-03 06:24
right.

detert
2019-07-03 06:24
Thank you very much. I'll think about it and give it a try

bethskurrie
2019-07-03 06:25
I'm trying to think of a way to support your usecase by adding a different event type, but there's no real way to make a new event type that makes sense without changing the existing one, and that would affect all the existing builds that depend on it.

detert
2019-07-03 06:28
Would something like this make sense? ``` "events": [{ "name": "contract_content_changed", "options": "ignore_additional_tags" }] ```

bethskurrie
2019-07-03 06:29
it might

bethskurrie
2019-07-03 06:29
i'll give it some thought

detert
2019-07-03 06:29
Great. I can create a pact-broker as well if that helps

detert
2019-07-03 06:29
+issue

bethskurrie
2019-07-03 06:29
sure

antonello
2019-07-03 08:21
Hi @bethskurrie. We?ve running into performance issues with the broker. Basically we have some participants with so many versions that loading some of the matrixes takes a very long time, but even worse, some queries end up making the whole host machine unusable. I know any resources can be deleted, but do you have any tips on how to reasonably approach a clean-up? I imagine we?re not the first to come across this.

bethskurrie
2019-07-03 08:41
What you can delete depends on how you're using it

bethskurrie
2019-07-03 08:41
I have written some clean up scripts in the past, but it's hard to generalise because people use their brokers differently.

bethskurrie
2019-07-03 08:41
Do you use tags?

antonello
2019-07-03 08:42
yes, we use tags - each pipeline (master and feature branches) publishes and/or verifies

bethskurrie
2019-07-03 08:42
do you use tags for stages (prod dev) or just for branches?

antonello
2019-07-03 08:43
we?ve started using prod tags

antonello
2019-07-03 08:44
but yeah, for stages and branches

bethskurrie
2019-07-03 08:44
ok, so you can delete anything that isn't the latest for any tag, except for the ones that are on master that might be promoted to prod

bethskurrie
2019-07-03 08:44
does that make sense?

bethskurrie
2019-07-03 08:44
I'll see if I can revive the clean up script I had.

bethskurrie
2019-07-03 08:44
would a date based approach work?

bethskurrie
2019-07-03 08:45
ie. delete anything older than x days?

bethskurrie
2019-07-03 08:47
also, side note, is it rendering the matrix page in the browser that takes ages, or is it the can-i-deploy?

antonello
2019-07-03 08:55
rendering the matrix - we have just started using can-i-deploy but not for the problematic pacticipants

antonello
2019-07-03 08:56
but also getting the list of all versions, which actually brings the host ?down?

bethskurrie
2019-07-03 08:56
fun.

bethskurrie
2019-07-03 08:56
what it really needs is paging, but I don't think I have the time for that right now

antonello
2019-07-03 08:56
I think older than x days would work

bethskurrie
2019-07-03 08:57
are you using the docker image?

antonello
2019-07-03 08:57
yes

bethskurrie
2019-07-03 08:58
ok, in the docker image there is a clean task


bethskurrie
2019-07-03 09:00
if you hop into your docker container and go to `/home/app/pact_broker/` and execute `bundle exec rake pact_broker:db:clean` it will delete stuff.

bethskurrie
2019-07-03 09:00
BUT

bethskurrie
2019-07-03 09:01
I'm not 100% sure it will delete the right stuff. I have unit tested it, but when I pulled down a live database, extracted the data that's on the index page, ran the script, and then looked at the index page again, there were some diffs, and there shouldn't have been.

bethskurrie
2019-07-03 09:01
Nobody was jumping up and down about needing the clean, so at the time, I didn't go any further with it.

bethskurrie
2019-07-03 09:02
what it was supposed to do was get rid of every pact publication that was not the latest for it's tag.

bethskurrie
2019-07-03 09:02
I think it did that ok, but from memory, some of the verifications were different.

antonello
2019-07-03 09:06
So that would be your recommended approach, aside from it potentially not deleting exactly the right stuff.

bethskurrie
2019-07-03 09:06
are you comfortable with being a DBA?

antonello
2019-07-03 09:06
not me personally!

bethskurrie
2019-07-03 09:07
that's probably your best bet then.

bethskurrie
2019-07-03 09:07
I could give you some SQL to run, as an alternative

bethskurrie
2019-07-03 09:07
but you'd need someone to get access to the database and run it for you

antonello
2019-07-03 09:07
I?m sure we have people here you may be ore comfortable with that.

antonello
2019-07-03 09:08
I have access, I would just want someone else to do it :smile:

antonello
2019-07-03 09:08
we have backups for the dockerised postgres instances we?re running as a sidecar.

bethskurrie
2019-07-03 09:08
:thumbsup::skin-tone-3:

antonello
2019-07-03 09:08
so the SQL may not be a bad shout, we can always test it

bethskurrie
2019-07-03 09:10
do you care about keeping your webhook execution results?

bethskurrie
2019-07-03 09:10
I can make the sql simpler if we just delete all of them

antonello
2019-07-03 09:12
nah, I don?t think we care - as long as the provider verifications remain

bethskurrie
2019-07-03 09:13
I've got something, I'll just test it locally

antonello
2019-07-03 09:15
thank you!


alessandrobuggin
2019-07-03 10:50
has joined #pact-broker

alessandrobuggin
2019-07-03 10:53
Hello, is there a way to test a new pact ?on a branch? without ?making it official?/publishing it? I do think the answer is no, because the provider approves a pact asynchronously.

antonello
2019-07-03 11:02
:pray:

matt.fellows
2019-07-03 11:07
Have you read the docs on tags?


alessandrobuggin
2019-07-03 12:05
nope I wasn?t aware. thanks for sharing :heart:

james.hattersley-dyke
2019-07-03 15:29
Hi I'm having a weird issue between my CI and my local environment... I've attached a pic as it'll explain it far better. Basically, different results between CI and the CLI locally.

sandhyarani.gabbi
2019-07-03 16:15
has joined #pact-broker

sandhyarani.gabbi
2019-07-03 16:18
Hi, PACT Broker is returning a 500 when trying to Publish(Works after several retries though). This is happening only on one of three services. Is there any reason why this could happen?

pact.io
2019-07-03 20:27
@bethskurrie I take a look at the implementation for some time now. I understand that the contract_content_changed event is triggered at PactBroker:Webhooks:TriggerService if the pact_version_sha changes. I understand as well that this method is called by PactBroker:Pacts:Service:update_pact. But I have no idea how or why the tag affects the pact_version_sha. As far as I see only params[:json_content] is used. Could you help me to understand what's going on?

pact.io
2019-07-03 21:02
As I think about this, I think that consumer_version.id changes every time as I use the last git hash as recommended in the docs. Thus PactBroker:Pacts:Service:create_pact might be called every time instead of update_pact. And then pact_repository.find_previous_pacts does not find a previous_pact if a new tag is provided which triggers the event. Does that make sense?

pact.io
2019-07-03 21:07
So, as you wrote earlier, the very first version is the exception here

matt.fellows
2019-07-03 21:22
:+1:

matt.fellows
2019-07-03 21:32
What do your logs say? Or are you using our hosted broker at http://pactflow.io?

matt.fellows
2019-07-03 21:35
Wow. Might need a verbose flag to see what's happening there

matt.fellows
2019-07-03 21:36
All I can think of is networking issue / caching or something

james.hattersley-dyke
2019-07-03 21:42
I did run it with the verbose flag, I'll upload the output tomorrow morning...

james.hattersley-dyke
2019-07-03 21:42
I'm baffled too!

bethskurrie
2019-07-03 21:56
Also @sandhyarani.gabbi which library are you using to publish? The latest versions of pact-jvm and go/js/.net have retires built in.

bethskurrie
2019-07-03 22:27
I'm very confused @james.hattersley-dyke. Check the X-Request-Id header and make sure that it's changing each time - that will rule out caching issues.

bethskurrie
2019-07-03 22:44
Any luck @antonello?

antonello
2019-07-04 00:19
We haven?t tried yet

johngluckjunk
2019-07-04 05:30
has joined #pact-broker


james.hattersley-dyke
2019-07-04 11:02
i noticed the CI was running before the local call . I updated the gist to show it's not an ci running after.

bethskurrie
2019-07-04 11:15
I notice you're using semantic versions, not git shas

bethskurrie
2019-07-04 11:16
Are you publishing multiple times with the same consumer version, or are you incrementing the version each time?

bethskurrie
2019-07-04 11:18
What does the matrix page look like for this integration?

antonello
2019-07-04 11:18
Tried this morning! It works perfectly!

bethskurrie
2019-07-04 11:18
Are you sure the verification result is not coming in after the ci ran, and before you checked from local.

bethskurrie
2019-07-04 11:19
It looks like you're publishing the pact then waiting a while for the verification to come back, but not long enough.

bethskurrie
2019-07-04 11:19
Awesome

bethskurrie
2019-07-04 11:20
I meant to ask, and it's probably too late now, but do you have any idea how many pact publications you had?

antonello
2019-07-04 11:21
We might even run it regularly as a cron job. The only issue I can foresee (which doesn?t affect us yet) is for any participants that we may have not built or released in the last n (e.g 60) days.

bethskurrie
2019-07-04 11:22
I was thinking I could build in a cron job into the docker container

bethskurrie
2019-07-04 11:23
The script just needs to be a bit smarter to avoid deleting pacts that are the latest for their tag, even if they're over 60 dayan

bethskurrie
2019-07-04 11:23
Days.

bethskurrie
2019-07-04 11:24
Your latest prod pact might easily be over 60 days with a stable integration.

antonello
2019-07-04 11:32
absolutely - once the script is smarter, you can also be more aggressive in terms of retention window

bethskurrie
2019-07-04 11:37
What is the error message that you get with the 500?

bethskurrie
2019-07-04 11:38
By the time you run it locally, the verification has arrived.

bethskurrie
2019-07-04 11:39
Then you publish a new version of the pact and the content has changed, so it goes back to being unverified.

bethskurrie
2019-07-04 11:55
If you add the git sha into the version number, you may get more predictable results. Eg 1.2.3±fjjdisjebfhfu



antonello
2019-07-05 07:46
I voted on Twitter :slightly_smiling_face:

matt.fellows
2019-07-05 07:51
Thank you!!

fun_rajesh
2019-07-05 12:29
has joined #pact-broker

fun_rajesh
2019-07-05 12:29
Hi, I received a mail from with a temporoary password. However, when i signed in https://<myusername>.http://pact.dius.com.au , the credentials were not identified. May I know how to start using the pact broker hosted in the cloud by Pact team.

james.hattersley-dyke
2019-07-08 08:37
Hey, sorry been on paternity leave with a new Dog! p.s kids are way easier than puppies! Thanks for looking into this @bethskurrie / @matt.fellows I've been using semantic versions as with each change the dev is required to increment the version number. That is enforced by the CI. I think this issue arose when two devs used the same version number as they were changing separate parts of the codebase in tandem. I'll try adding the git-sha to the version, I'll keep you posted how we get on!

bethskurrie
2019-07-08 08:52
@fun_rajesh send an email to Your credentials are only valid for 7 days and may have expired.

james.hattersley-dyke
2019-07-08 14:32
~Hey Beth, when the provider verification kicks off - does the broker return a 'pending state'? I've simply up the number of retries while waiting for the provider verification to happen and the CI passed. I'd previously had 3 retries but upped to 10. Which lead me to wonder if while verification is running the broker returns false?~

james.hattersley-dyke
2019-07-08 14:35
> It looks like you're publishing the pact then waiting a while for the verification to come back, but not long enough.

james.hattersley-dyke
2019-07-08 14:35
you nailed it

thamu.gurung
2019-07-08 20:05
has joined #pact-broker

phall
2019-07-08 20:59
Hi all, I?m trying to set up the Pact Broker to trigger Bitbucket pipeline builds. So far, so good. The issue I?m having is in triggering the correct branch. We are tagging Pacts based on their branch, and would like to verify ?feature_a? provider against ?feature_a? consumer, and ?master? against ?master? etc. The Bitbucket pipeline API call expects a single branch name to build, but the closest I can find from the ?contract_content_changed? event is ?${pactbroker.consumerVersionTags}? which gives ALL the tags. (e.g. ?master, stage, feature_a? as a single string) Is there a way to get just the last/latest tag when executing a webhook?

matt.fellows
2019-07-08 22:36
Beth has a habit of this

matt.fellows
2019-07-08 22:36
> Hey, sorry been on paternity leave with a new Dog! p.s kids are way easier than puppies! OK then that justifies my decision to have #2 :stuck_out_tongue:

laverya
2019-07-08 23:11
Is there a way to get a list of pact consumer version tags? Or, more concretely? I want to test a provider against all published versions of a consumer, so as to avoid any possible breakage of old versions. (I cannot, unfortunately, force users to use the latest version) Is there a recommended way to do this?

laverya
2019-07-08 23:14
Ideally I?d prefer to run the test suite for for each unique set of pact content, but I?m fine with running more times than strictly necessary

laverya
2019-07-08 23:26
Also that

laverya
2019-07-09 00:11
Currently the best solution I?ve found is this: ``` curl --silent --show-error --fail --user ${PACT_BROKER_BASE_URL_USERNAME}:${PACT_BROKER_BASE_URL_PASSWORD} -X GET -H "Content-Type: application/json" https://replicated-pact-broker.herokuapp.com/pacts/provider/prem-graphql-api/ | jq '._links."pb:pacts"' | sed -n 's/.*ship\/version\/\(v[^"]*\).*/\1/p' ``` But I?m not really happy with that for a variety of reasons

bethskurrie
2019-07-09 00:40
@phall typically when you publish a pact, you just start by tagging it with the branch name. What other tag names are you finding in there?

bethskurrie
2019-07-09 00:41
You'd only add the stage when it gets deployed to an environment.

bethskurrie
2019-07-09 00:42
@laverya is this a mobile consumer?

bethskurrie
2019-07-09 00:42
Are you using tags?

bethskurrie
2019-07-09 00:42
And which language are you verifying in?

laverya
2019-07-09 00:43
What do you mean by mobile consumer?

laverya
2019-07-09 00:44
I don?t think we?re using tags in the manner you mean, just creating a different consumer version for each release

laverya
2019-07-09 00:44
Verifying in typescript

laverya
2019-07-09 00:46
(if I need to add tags to the consumers in order to make this easier, I can do that)

bethskurrie
2019-07-09 00:47
If your consumer tags every pact they want to be backwards compatible as "prod" then you can verify all prod pacts.

bethskurrie
2019-07-09 00:47
I'll just need to make sure this option is exposed in pact-js.

bethskurrie
2019-07-09 00:47
it's in the underlying library.

bethskurrie
2019-07-09 00:47
you really don't want to verify every pact ever!

laverya
2019-07-09 00:48
Oh interesting I hadn?t realized that multiple versions could be tagged as prod (or at least that they would be returned together)

bethskurrie
2019-07-09 00:48
usually you only care about the latest tagged version if the consumer is running on a single server, but for mobile consumers, you care about all the prod versions.

bethskurrie
2019-07-09 00:49
Have a think about it though, and think if you could verify the first prod pact and the last prod pact - if both of those were valid, do the intermediate ones matter?

bethskurrie
2019-07-09 00:49
they might - I'm just wondering

laverya
2019-07-09 00:50
> if both of those were valid, do the intermediate ones matter? They don?t, until we make more than one change to the same query Which means they do :disappointed:

bethskurrie
2019-07-09 00:50
if, at each time you released a new prod version, you knew it was compatible with the first prod pact, and the most recent prod pact, then it might actually be enough.

bethskurrie
2019-07-09 00:50
ok.

laverya
2019-07-09 00:51
In our case CI time isn?t really something I?m going to worry about yet Only if it becomes a problem

bethskurrie
2019-07-09 00:51
cool

bethskurrie
2019-07-09 00:52
I think I'll have to do a little work to make the thing you want available, but it shouldn't be much.

bethskurrie
2019-07-09 00:53
If you can wait a few days, I'll get back to you. I give you permission to ping me directly to remind me about it if I forget! (usually I don't like it if people do that!)

laverya
2019-07-09 00:56
Awesome, thank you! But before you do I just want to make sure we?re thinking of the same pact provider And it seems to be `@pact-foundation/pact-node`

laverya
2019-07-09 00:58
(and `@pact-foundation/pact`)

bethskurrie
2019-07-09 00:59
yup

asite.mshah
2019-07-09 06:05
has joined #pact-broker

phall
2019-07-09 13:20
Our branching strategy is typically `feature_a` merged into `master`. If the pact is published by CI, we see the same pact tagged with `feature_a` and `master`. Deployment happens from `master`. Sometimes we deploy to additional environments by merging into a branch (e.g. `stage` or `test`) - if this is the case, CI will also tag the pacts with these branch names.

phall
2019-07-09 13:22
:point_up: This means that if the same pact test is merged `feature_a` -> `test`, then -> `master`, it will have three tags.

phall
2019-07-10 14:48
@bethskurrie just to follow up on this, is our branching/tagging strategy different from what you?d expect? An alternative approach would be for the webhook to trigger a special job, which would parse the tags and trigger the CI build.

sandhyarani.gabbi
2019-07-10 16:36
@matt.fellows We are pulling the docker image from https://hub.docker.com/r/dius/pact-broker and then hosting it with AWS ECS.

sandhyarani.gabbi
2019-07-10 16:40
@beth We are using PACT JVM 3.6.0 Version. We are planning on upgrading to newer version in sometime. The error message I get is "FAILED! 500 Internal Server Error - Unknown error" [ERROR] Failed to execute goal au.com.dius:pact-jvm-provider-maven_2.12:3.6.0:publish (default-cli) on project xxx: One or more of the pact files were rejected by the pact broker

bethskurrie
2019-07-15 04:00
@phall So, the tags belong to the consumer version, not the pact. This tells me that you're using the same consumer version in multiple branches. That's your problem.


bethskurrie
2019-07-15 04:07
Yes.

thakkarjinal29
2019-07-15 15:00
Hello, I am facing a weird issue. When I pass the flag `--custom-provider-header` with a basic auth token, it tries to authenticate my `provider state url` instead of using it for a test within. However, once I run the test without the `--custom-provider-header` flag and then re-run it with the same, it does what it is supposed to and not try and authenticate my `provider state url` this is the command I am using ``` ./pact-provider-verifier --pact-broker-base-url="https://test.pact.dius.com.au/" --provider-base-url="http://127.0.0.1:8000" -c "http://127.0.0.1:8000/_pact/provider_states/" -a $CIRCLE_SHA1 -v --provider=testprovider --broker-token=$BROKER_TOKEN --custom-provider-header='Authorization: Basic XYZ=' ``` Would be great if someone could help

bethskurrie
2019-07-15 21:59
@thakkarjinal29 can you provide an executable example in a github repo and raise an issue in the pact-provider-verifier repository please?

bqiu
2019-07-16 00:06
has joined #pact-broker

thakkarjinal29
2019-07-16 04:27
Sure, would do it, thanks Beth :slightly_smiling_face:

bart.schotten
2019-07-16 13:12
I may be misunderstanding things, but it seems strange to me that can-i-deploy fails when there is no version of a provider yet that is tagged with the environment you want to deploy to. If services A and B are each other's consumers, this seems to cause a deadlock situation where you can never deploy one before you deploy the other. I would expect can-i-deploy to only check for any existing integrations that fail.

denis.ducansel
2019-07-18 09:30
has joined #pact-broker

laverya
2019-07-19 22:41
Any updates here?

bethskurrie
2019-07-20 00:59
Sorry, it's been in the back of my mind, but I haven't had time.

laverya
2019-07-20 00:59
That?s fine

bethskurrie
2019-07-20 00:59
Things are a bit nuts atm trying to get Pactflow features out.

laverya
2019-07-20 01:00
It?s no problem We?re managing for now

bethskurrie
2019-07-20 01:00
:thumbsup::skin-tone-3:

thakkarjinal29
2019-07-21 16:16
Hi, this was a bug on my part. Sorry for the confusion!

kapoorvishal23
2019-07-22 10:50
has joined #pact-broker

davmitchell
2019-07-24 00:40
has joined #pact-broker

sandhyarani.gabbi
2019-07-24 20:27
Closing this thread as changing the PACT Broker port has resolved my issue.

getsreerag22
2019-07-26 02:30
has joined #pact-broker

hvgiitr
2019-07-26 04:18
has joined #pact-broker

au443479
2019-07-26 05:58
has joined #pact-broker

pkuang
2019-07-26 20:13
Hi can someone take a look at the issue I reported above and confirm if my assumptions are correct for this bug?

william.robson
2019-07-30 09:50
has joined #pact-broker

kyle.hammond
2019-07-30 20:11
has joined #pact-broker

chaoscifer
2019-08-03 21:27
has joined #pact-broker

tjones
2019-08-04 02:06
For can-i-deploy, is it meaningful / useful to specify both a version and a tag?

bethskurrie
2019-08-06 09:49
No

bethskurrie
2019-08-06 09:50
@tjones it's an invalid query. If you're talking about, for the same app.

bethskurrie
2019-08-06 09:50
You could specify one app with a tag, and another with a version number, if you were listing your apps explicitly.

mohindroo.deepak
2019-08-06 14:48
has joined #pact-broker

mohindroo.deepak
2019-08-06 14:49
How to install pact broker in azure devops? I do not want to use docker image. Want to do installation manually?

pbarrientos
2019-08-06 15:17
has joined #pact-broker

mohindroo.deepak
2019-08-06 19:24
??

matt.fellows
2019-08-06 21:11
Deepak, I?m not sure how to do it in Azure DevOps specifically, but there are instructions on the wiki on how to run it

matt.fellows
2019-08-06 21:11
it?s a Ruby App, so you will need to automate a Ruby environment setup and run it behind a web server (e.g. nginx)

matt.fellows
2019-08-06 21:12
If you don?t want to run Docker, that?s OK, but you might want to look at how the Docker app is structured - that has most of the moving parts in it

matt.fellows
2019-08-06 21:12
Alternatively, you could look at using http://pactflow.io which is a fully managed pact broker with extras

mohindroo.deepak
2019-08-07 05:07
Can you share the wiki page of instructions? Can i install this on windows machine manually? What is the alternative if we do not use broker here?


matt.fellows
2019-08-07 05:09
you could store the pacts in Git / version control, use build artifacts, or upload them to a blob store like S3 (or build your own thing - but at that point, you?re better off just using the broker)

mohindroo.deepak
2019-08-07 06:03
Any samples for storing in blob ? How pact verifier will fetch from there? Do we need to write our own code for storing and fetching?

matt.fellows
2019-08-07 06:03
No and yes (sorry, on the go...)

matt.fellows
2019-08-07 06:25
If you?re just trying to get a demo going, just store the files somewhere everyone can access them. The verifier can point to the URL of the pacts and off you go

matt.fellows
2019-08-07 06:25
if you want to do proper CI/CD with it, Pact Broker is your best bet by a long shot. You?ll eventually start wanting to do most of the things it does

mohindroo.deepak
2019-08-07 06:54
Actuall i have already tried with fileshare but now we need to look into permanent solution. We cannot do any outside hosting due to company policy. We need to setup pact broker in our systems. Is Pact broker installation really difficult to do? Another point: if we use fileshare then whats the issue in cicd pipelines

matt.fellows
2019-08-07 07:03
> Is Pact broker installation really difficult to do? No, but you?ll need somebody who knows how to run / operate a Ruby app properly > Another point: if we use fileshare then whats the issue in cicd pipelines See https://docs.pact.io/best_practices/pact_nirvana. You?ll often want to be able to version contracts, test against different versions of contracts, orchestrate deployment pipelines by knowing which components are compatible with others etc. This gets harder when all you have is a file system. The broker represents all of these and more as first class citizens. > We cannot do any outside hosting due to company policy. That?s OK, you don?t have to use Pactflow (but if there is something we can do to make it easier do let us know). I?d go with self-hosting a broker then, it?s the best move.

mohindroo.deepak
2019-08-07 07:40
Where can i get docker image of pact broker?

bethskurrie
2019-08-07 07:41
Search in docker hub.

pbarrientos
2019-08-07 15:03
Does it exist for Windows Docker?

amber.race
2019-08-07 21:48
has joined #pact-broker

brent.foley
2019-08-07 22:42
has joined #pact-broker

bethskurrie
2019-08-07 23:33
Isn't it the same?

matt.fellows
2019-08-07 23:37
It?s a linux container. So wherever you can run the linux container it should run. We?ve never tested it on a Windows underlying host, but the whole point of Docker is that it shouldn?t matter.

bethskurrie
2019-08-07 23:44
It should work, because people run it in in Azure, I'm sure.

matt.fellows
2019-08-08 00:14
yep

sbellew
2019-08-08 02:36
has joined #pact-broker

antstorm
2019-08-08 08:38
has joined #pact-broker

pbarrientos
2019-08-08 14:28
Perfect, Thanks, guys.

mohindroo.deepak
2019-08-09 10:12
Should i use pactbroker dius image? Is this verified or certified?

matt.fellows
2019-08-09 10:29
This is the official image: https://hub.docker.com/r/pactfoundation/pact-broker (we?ve recently migrated from the DiUS image - hence the 500k+ pulls)

matt.fellows
2019-08-09 10:29
You?re safe with both, but we are pushing new changes to the foundation - so I?d start there

matt.fellows
2019-08-09 10:30
?certified? isn?t a thing, the closest is our managed broker at https://pactflow.io. If you need / want ?support?, we could probably discuss how we help with that situation

mohindroo.deepak
2019-08-09 11:07
Ok thanks

matt.fellows
2019-08-09 12:27
:+1:

enrique
2019-08-09 12:32
I think it is ?deprecated?. The new one seems to be: https://hub.docker.com/r/pactfoundation/pact-broker/

david862
2019-08-16 14:09
has joined #pact-broker

david862
2019-08-16 14:09
@david862 has left the channel

mohindroo.deepak
2019-08-16 15:42
I am trying to run the pact verify code in dotnet and it works with pact file but not working with url. Giving some ruby files error? Need some help or code snippet to do that.

matt.fellows
2019-08-17 02:42
@mohindroo.deepak please give us more info - we can?t help with that

matt.fellows
2019-08-17 02:42
What are you doing (show us code and relevant logs)? What have you tried to remediate? What docs have you read? is the broker local or a hosted one? ?

mohindroo.deepak
2019-08-18 16:01
I am using hosted pact broker and when i try to verify using standard pact verify code, i got this error. Can you refer any link where i can see the code snippet how to fetch from hosted pact broker?

matt.fellows
2019-08-18 22:49
Did you mean to paste an error?

matt.fellows
2019-08-18 22:49
What language are you using? What have you tried so far?


chuck
2019-08-19 00:59
has joined #pact-broker

mohindroo.deepak
2019-08-19 05:34
I am using pactnet for publishing the verify results.

matt.fellows
2019-08-19 05:43
What have you tried?

matt.fellows
2019-08-19 05:43
You said there was an error, can you please share it?

mohindroo.deepak
2019-08-19 05:45
I cannot find any dotnet example here. Is it possible to publish using dotnet?

matt.fellows
2019-08-19 05:48
Yes, it's outlined in the readme

mohindroo.deepak
2019-08-19 10:12
I have done verification of pact in dotnet core code using pactnet but how will i publish this to pact broker?

matt.fellows
2019-08-19 10:33
See comment above. It's also in the readme

mohindroo.deepak
2019-08-19 10:38
That is related to pactflow

mohindroo.deepak
2019-08-19 10:39
I am using internal pack broker

mohindroo.deepak
2019-08-19 10:39
And pactnet as language

matt.fellows
2019-08-19 10:42
ok. What are you wanting to do that's not in the readme?

matt.fellows
2019-08-19 10:43
You want to publish the verification results?

mohindroo.deepak
2019-08-19 11:48
Actually i am using pactnet for verify the pacts from broker

mohindroo.deepak
2019-08-19 11:49
So when publish will come here? From verify function i am getting success or exception in loger so what info i should send to broker?


mohindroo.deepak
2019-08-19 16:36
That works and able to update results

mohindroo.deepak
2019-08-19 16:37
Thanks

ben.minter
2019-08-21 08:30
has joined #pact-broker

ben.minter
2019-08-21 08:33
Hey, we are planning on using the https://hub.docker.com/r/pactfoundation/pact-cli but it looks like it only has a `latest` tag and no concrete versions, is this intentional or could versioning be added? Thanks!

bethskurrie
2019-08-21 09:44
Can you raise an issue and I'll add the code for versioning it.

bethskurrie
2019-08-21 09:45
@tanle.oz is this something you might be interested in adding?

tanle.oz
2019-08-21 09:45
has joined #pact-broker

tanle.oz
2019-08-21 09:49
I need more context on this though, but happy to help

gopinathlangote11
2019-08-21 10:37
Hello Pact Maintainer - I have a question about Pact Broker ? Does pact broker support `access management` - Read, Write as separate permissions!

bethskurrie
2019-08-21 10:42
The OSS docker image supports a read only basic auth user and a read/write basic auth user. Anything more than that will require you to write custom Ruby middleware. Full permissions support is planned for Pactflow however (the commercial fork of the Pact Broker that Ron, Matt and I are working on).

bethskurrie
2019-08-21 10:42
Of course. Let's chat about it next time we catch up.

antonello
2019-08-21 11:23
I?ll remind @ben.minter to add an issue on the pact-broker repo.

antonello
2019-08-21 11:24
He sits a couple of desks away from me :slightly_smiling_face:

ben.minter
2019-08-21 11:33
I have raised the issue, thanks :smile:

thomas.heilbronner
2019-08-21 13:21
Is the open source pact broker still the base for pact flow or is it a hard fork?

mohindroo.deepak
2019-08-21 15:30
Is pact work for amqp messaging. My use case is that i am sending lot of messages to azure service bus/kafka so how will i handle those contracts? Any samples for that?

matt.fellows
2019-08-21 20:33
What language? And yes. Search for message pact examples

bethskurrie
2019-08-21 21:06
Ta. So far there's basically been only one version!

mohindroo.deepak
2019-08-22 10:27
Pactnet

matt.fellows
2019-08-22 10:30
Ok you'll need to look at the current outstanding PR then. It's being used by some but not yet merged into the mainline. Your feedback on it would be welcomed

samuel.hodgkinson
2019-08-22 11:35
has joined #pact-broker

deshdeepdivakar
2019-08-23 05:35
has joined #pact-broker

deshdeepdivakar
2019-08-27 02:16
hi @here guys, where to specify `pact.verifier.publishResults=true` I don't want to have it in my gradle script. Cheers

deshdeepdivakar
2019-08-27 02:37
Found it I just needed to set them in my test file ``` val props = System.getProperties() props["pact.provider.version"] = "1.0.2" props["pact.verifier.publishResults"] = "true" System.setProperties(props)```

bethskurrie
2019-08-27 08:45
It's still the base @thomas.heilbronner

bethskurrie
2019-08-27 08:46
Some features get released in pactflow first because I do the dev in the OSS codebase and then beta them in pactflow before I do a release of the oss gem.

davidjgmendes
2019-08-28 17:31
Greetings, I have an issue with webhooks in pact_broker. I currently have the broker in the same machine as jenkins. I'm trying to trigger a jenkins job with the webhook but I get the message "Failed to open TCP connection to localhost:5656 (Address not available - connect(2) for \"localhost\" port 5656)". Jenkins is running on port 5656 and it seems I am not able to reach it. I have already disabled cors and whitelisted the http method. Any ideas?

matt.fellows
2019-08-28 21:49
Localhost might also be blocked. I can't recall, but worth checking if that's in the host whitelist

evman182
2019-08-28 22:46
has joined #pact-broker

evman182
2019-08-28 22:46
as it turns out, I came here to ask about that ^

matt.fellows
2019-08-28 22:49
Oh that's a bummer! I'm not in front of my laptop but will see if I can repro when I land at my desk

evman182
2019-08-28 22:53
is there an additional step spinning up the example application to setup the sqlite db?

bethskurrie
2019-08-28 22:56
Are you following the instructions to run it from the example directory?

bethskurrie
2019-08-28 22:56
Or trying to run it from the root dir?

bethskurrie
2019-08-28 22:57
Can you curl it?

bethskurrie
2019-08-28 22:58
From the box itself?


bethskurrie
2019-08-28 23:05
Delete the existing sqlite dB and try again

evman182
2019-08-28 23:08
huh?

evman182
2019-08-28 23:09
I'm gonna try running it with postgres just for the sake of trying to move on

bethskurrie
2019-08-28 23:10
there's an existing pact_broker_database.sqlite3 file in the example directory. Delete it.

evman182
2019-08-28 23:11
don't I need it? or will running rackup recreate it?

bethskurrie
2019-08-28 23:11
rackup will recreated it

evman182
2019-08-28 23:11
with the sample data?

bethskurrie
2019-08-28 23:11
you'll get some sample data from the app

bethskurrie
2019-08-28 23:11
it will seed itself.

evman182
2019-08-28 23:25
that worked, but I can't reach it from outside the container

evman182
2019-08-28 23:25
is there a default setting that only allows connections from localhost?

bethskurrie
2019-08-28 23:26
I don't know. @tanle.oz can you help?

bethskurrie
2019-08-28 23:28
I don't use docker to develop, Tan set this up recently. He should be able to help.

evman182
2019-08-28 23:28
thanks

bethskurrie
2019-08-28 23:28
A quick look at the dockefile shows that no ports are exposed though.

evman182
2019-08-28 23:28
I called docker run with -p 9292:9292

evman182
2019-08-28 23:29
which I think would cover that, but I'm honestly not sure

bethskurrie
2019-08-28 23:29
I think you have to expose port 9292 from the dockerfile

evman182
2019-08-28 23:29
I'm neither a docker or ruby expert, lol

bethskurrie
2019-08-28 23:29
What problem are you trying to solve?

evman182
2019-08-28 23:32
lol, in the UI, when you're looking at the list of Pacts, because the `Latest pact published` column contains strings like `2 months ago` rather than a date, sorting that column doesn't work as you'd expect as it's sorting those english strings

bethskurrie
2019-08-28 23:32
Ah yes.

evman182
2019-08-28 23:33
not exactly critical, but :man-shrugging:

bethskurrie
2019-08-28 23:33
I appreciate any help!

evman182
2019-08-28 23:33
:+1:

bethskurrie
2019-08-28 23:34
You'll find that the matrix works properly because of this: ``` $("#matrix").tablesorter({ textExtraction : function(node, table, cellIndex){ n = $(node); return n.attr('data-sort-value') || n.text(); } }); ```

bethskurrie
2019-08-28 23:35
The index doesn't have the logic that allows it to sort on the data-sort-value attribute

bethskurrie
2019-08-28 23:35
``` $("#relationships").tablesorter(); ```

bethskurrie
2019-08-28 23:36
This is the view model that you'll need to add the sort field to lib/pact_broker/ui/view_models/index_item.rb

bethskurrie
2019-08-28 23:37
It's currently sorting on this: ``` def publication_date_of_latest_pact date = @relationship.latest_pact.created_at PactBroker::DateHelper.distance_of_time_in_words(date, DateTime.now) + " ago" end ```

evman182
2019-08-28 23:45
yep, but I think with the version of tablesorter being used there's a cleaner option, but once I get it running I'll see

bethskurrie
2019-08-28 23:45
:thumbsup::skin-tone-3:

bethskurrie
2019-08-28 23:45
I'm not a javascript expert :stuck_out_tongue:

tanle.oz
2019-08-29 00:04
@evman182 I am catching up to the message threads

bethskurrie
2019-08-29 00:05
I think we need an EXPOSE 9292 in the docker file to allow the runnning broker instance to be accessed from outside the container

tanle.oz
2019-08-29 00:08
Or you can run `-p 9292:9292` as @evman182 suggested as a work-around for the time being.

tanle.oz
2019-08-29 00:08
I can whip up a PR to add the `EXPOSE` to the `Dockerfile`

bethskurrie
2019-08-29 00:08
I thought you needed the expose as well? But I'm not a docker expert!

bethskurrie
2019-08-29 00:08
It didn't seem to work for Evan though

tanle.oz
2019-08-29 00:13
`EXPOSE` only defines incoming ports inside the container, to access this internal port we still need to define what port on the host this one is bound to, hence `- p`

tanle.oz
2019-08-29 00:17
Can you try this @evman182 ``` docker run --rm -p 9292:9292 -v $(PWD):/app -it pact_broker:dev bash # On docker bundle exec rackup -o 0.0.0.0 ```

evman182
2019-08-29 00:21
bingo

evman182
2019-08-29 00:22
adding the -o switch did it

bethskurrie
2019-08-29 00:22
:thumbsup::skin-tone-3:

bethskurrie
2019-08-29 00:22
ah, of course

davidjgmendes
2019-08-29 08:43
I can curl it from the box

davidjgmendes
2019-08-29 08:44
I made sure anonymous users are capable of triggering this specific job to test

davidjgmendes
2019-08-29 08:45
Modified the http://conifg.ru to have config.webhook_host_whitelist = [/.*/]. Still does not work

bethskurrie
2019-08-29 08:51
Doesn't seem like the env var is making it to the Ruby process

bethskurrie
2019-08-29 08:54
Sorry, I'm getting confused with another issue.

bethskurrie
2019-08-29 08:58
How are you running your broker?

bethskurrie
2019-08-29 08:58
Directly on the box, or in docker?

bethskurrie
2019-08-29 08:59
Can you modify this code and make it attempt to do your Jenkins request?

bethskurrie
2019-08-29 08:59
``` require 'net/http' require 'uri' uri = URI("https://postman-echo.com/post") req = Net::HTTP::Post.new(uri) response = Net::HTTP.start(uri.hostname, uri.port, :ENV, use_ssl: true) do |http| http.request req end puts response.code puts response.to_hash puts response.body ```

bethskurrie
2019-08-29 08:59
Run `irb` where you are running your broker, and execute that.

davidjgmendes
2019-08-29 09:18
I used the docker-compose provided here https://github.com/DiUS/pact_broker-docker I am quite new to docker tbh

bethskurrie
2019-08-29 09:19
OK, so the localhost from within your docker container is not the same localhost as the machine you're running docker on.

bethskurrie
2019-08-29 09:20
You'll need to use a proper ip or host name to access it.

davidjgmendes
2019-08-29 09:20
Right, that makes sense. Damn, thanks for the help

bethskurrie
2019-08-29 09:21
Np

matt.fellows
2019-08-29 10:14
I was going to say if it's binding to 127.0.0.1 it won't be externally available

matt.fellows
2019-08-29 10:15
This tricks everyone (who uses docker to expose servers)

matt.fellows
2019-08-29 10:18
Another approach is to look at using another network mode that bridges the host machine, so then it would be the same network and localhost would work. If the Jenkins machine has a DNS name though, that would be best

bart.schotten
2019-08-29 11:14
I get a 500 error when trying to delete a pacticipant version. Deleting a tag for example works fine. Unfortunately I don't have access to the logs, but what could cause this? https://github.com/pact-foundation/pact_broker/wiki/Deleting-resources suggests it should be possible. We are running dius/pact-broker 2.31.0-1

bart.schotten
2019-08-29 11:48
I can even delete an entire pacticipant...

bart.schotten
2019-08-29 12:59
Ah, I now have access to the logs and there we go: ERROR -- : PG::ForeignKeyViolation: ERROR: update or delete on table "pact_publications" violates foreign key constraint "triggered_webhooks_pact_publication_id_fkey" on table "triggered_webhooks" Looks like a bug.

bethskurrie
2019-08-29 20:53
Yes it does @bart.schotten. Can you raise an issue in the pact broker repository please?

jing.song
2019-08-29 23:59
has joined #pact-broker

priyank.shah217
2019-08-30 05:49
has joined #pact-broker

priyank.shah217
2019-08-30 06:03
hello

priyank.shah217
2019-08-30 06:04
i am using docker image of pact broker.. and its running fine CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES c177c7535618 dius/pact-broker ?/sbin/my_init? 9 hours ago Up 9 hours 0.0.0.0:80->80/tcp, 443/tcp pactbroker 6afa398705a3 postgres ?docker-entrypoint.s?? 9 hours ago Up 9 hours 5432/tcp kind_bohr 538ad6d3f68c postgres ?docker-entrypoint.s?? 9 hours ago Up 9 hours 5432/tcp pactbroker-db

priyank.shah217
2019-08-30 06:05
so now issue is that i want to publish pact file to pact broker? so my question is that shall i used ?pactbroker? as hostname of pactbroker

priyank.shah217
2019-08-30 06:05
?

priyank.shah217
2019-08-30 06:06
`<plugin>` ` <groupId>au.com.dius</groupId>` ` <artifactId>pact-jvm-provider-maven</artifactId>` ` <!-- 4.0.0-beta.5-->` ` <version>${pact.version}</version>` ` <configuration>` ` <pactBrokerUrl>http://pactbroker/</pactBrokerUrl>` ` <pactDirectory>${project.build.directory}/pacts</pactDirectory>` ` <projectVersion>${project.version}</projectVersion>` ` <trimSnapshot>true</trimSnapshot> <!-- Defaults to false -->` ` </configuration>` ` </plugin>`

bethskurrie
2019-08-30 06:06
are you running it on your locahost?

priyank.shah217
2019-08-30 06:06
yes

bethskurrie
2019-08-30 06:06
Can you see it in your browser?

priyank.shah217
2019-08-30 06:06
http://pactbroker ? is not working anymore

bethskurrie
2019-08-30 06:07
It's going to be where you mapped it to when you started your docker instance.

bethskurrie
2019-08-30 06:07
How did you start it?

priyank.shah217
2019-08-30 06:07
oh my bad.. let me ty with http://localhost/

priyank.shah217
2019-08-30 09:33
`<plugin>` ` <groupId>au.com.dius</groupId>` ` <artifactId>pact-jvm-provider-maven</artifactId>` ` <version>${pact.version}</version>` ` <configuration>` ` <pactBrokerUrl>http://localhost</pactBrokerUrl>` ` <serviceProviders>` ` <!-- You can define as many as you need, but each must have a unique name -->` ` <serviceProvider>` ` <name>TweetProvider</name>` ` <consumers>` ` <consumer>` ` <name>TweetConsumer</name>` ` <!-- currently supports a file path using pactFile or a URL using pactUrl -->` ` <pactUrl>http://localhost/pacts/provider/TweetProvider/consumer/TweetConsumer</pactUrl>` ` </consumer>` ` </consumers>` ` </serviceProvider>` ` </serviceProviders>` ` </configuration>` ` </plugin>`

priyank.shah217
2019-08-30 09:33
@bethskurrie, is it correct way to provide path of pact file ?http://localhost/pacts/provider/TweetProvider/consumer/TweetConsumer???

priyank.shah217
2019-08-30 09:34
I m hosting pactfile using broker.. so able to publish contract from consumer side.. now i want to validiate it from producer side


priyank.shah217
2019-08-30 09:41
:+1: thanks will look into it

nyarasha
2019-08-30 18:54
has joined #pact-broker

bart.schotten
2019-09-02 05:51
Thanks for the quick fix. Awesome!

apurvjpatel
2019-09-02 07:46
has joined #pact-broker

gaurav
2019-09-03 02:52
Hello.. are there helm charts for pact broker deployment with kubernetes? Thanks.

bethskurrie
2019-09-03 04:00
Given that I've never heard of them until I googled it just then, no, unfortunately.


bethskurrie
2019-09-03 04:01
Amazing!

priyank.shah217
2019-09-05 07:08
Hi all, I am not able to trigger producer test using webhooks { ?consumer?: { ?name?: ?TweetConsumer? }, ?provider?: { ?name?: ?TweetProvider? }, ?request?: { ?method?: ?POST?, ?url?: ?http://localhost:8080/job/ContractProducer/job/master/build?token=<SOME_TOKEN>?, ?username?: ?<USERNAME>?, ?password?: ?<SOME_TOKEN>?, ?headers?: { ?Accept?: ?application/json? } }, ?events?: [ { ?name?: ?contract_published? } ] } is not trigger producer job, but when i tried the same thing using cURL it triggered job. Please find below is my cURL `curl -X POST -u ?USERNAME:TOKEN? ?http://localhost:8080/job/ContractProducer/job/master/build?token=TOKEN? Is there any changed in request body of web-hook? Note: I already whitelisted HTTP while launching pact-broker.

priyank.shah217
2019-09-05 07:09
any help would be appriciated..

bethskurrie
2019-09-05 07:10
What do the logs say?


bethskurrie
2019-09-05 07:14
Do you know where to look for the logs?

priyank.shah217
2019-09-05 07:25
yes

priyank.shah217
2019-09-05 07:25
i m checkjing inside containers

priyank.shah217
2019-09-05 07:27
Pact-broker log

priyank.shah217
2019-09-05 07:28
but now question is why i m allow to do same request using cURL command?

priyank.shah217
2019-09-05 07:29
here i m starting pact-broker.. `docker run --name pactbroker --link pactbroker-db:postgres -e PACT_BROKER_LOG_LEVEL="DEBUG" -e PACT_BROKER_WEBHOOK_SCHEME_WHITELIST="http https" -e PACT_BROKER_DATABASE_USERNAME=pactbrokeruser -e PACT_BROKER_DATABASE_PASSWORD=TheUserPassword -e PACT_BROKER_DATABASE_HOST=postgres -e PACT_BROKER_DATABASE_NAME=pactbroker -d -p 80:80 dius/pact-broker`

bethskurrie
2019-09-05 07:37
I can't help you unless you can find the logs.


priyank.shah217
2019-09-05 07:38
@bethskurrie i sent u log from containers

priyank.shah217
2019-09-05 07:38
okie..let me get NGNIX logs then


bethskurrie
2019-09-05 07:39
Ngnix logs won't help

bethskurrie
2019-09-05 07:40
How are you triggering the webhook?

priyank.shah217
2019-09-05 07:41
i have setup consumer and producer jobs in jenkins.. consumer jobs publish contract on broker and it should trigger producer jobs? so to make it happen i created hooks on pact-broker

priyank.shah217
2019-09-05 07:46
[2019-09-05T07:22:37Z] INFO: HTTP/1.1 POST http://localhost:8080/job/ContractProducer/job/master/build?token=111e424489b848f888d2df0226dec40aba [2019-09-05T07:22:37Z] INFO: accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3 [2019-09-05T07:22:37Z] INFO: accept: application/json [2019-09-05T07:22:37Z] INFO: user-agent: Ruby [2019-09-05T07:22:37Z] INFO: authorization: ********** [2019-09-05T07:22:37Z] INFO: null [2019-09-05T07:22:37Z] ERROR: Error executing webhook Jig0cm3F-2aGf_7poVMqwQ. For security purposes, the response details are not logged. To enable response logging, configure the webhook_host_whitelist property. See /doc/webhooks#whitelist for more information. [2019-09-05T07:22:37Z] INFO: Retrying webhook in 10 seconds

bethskurrie
2019-09-05 07:48
Please open and read the /doc/webhook#whitelist link in your broker

bethskurrie
2019-09-05 07:51
Localhost will be your docker container's localhost

bethskurrie
2019-09-05 07:51
You'll need to use an ip or hostname

priyank.shah217
2019-09-05 08:03
okie..

bethskurrie
2019-09-05 08:41
Any luck?

priyank.shah217
2019-09-05 08:42
yep

priyank.shah217
2019-09-05 08:42
eventually i m able to trigger :slightly_smiling_face:

priyank.shah217
2019-09-05 08:43
its new learning.. :slightly_smiling_face: will make do and don?ts for sure

priyank.shah217
2019-09-05 08:44
so basically i changed `docker run --name pactbroker --link pactbroker-db:postgres -e PACT_BROKER_LOG_LEVEL="DEBUG" -e PACT_BROKER_WEBHOOK_HOST_WHITELIST=XXX.XXX.XX.XX/YY -e PACT_BROKER_WEBHOOK_SCHEME_WHITELIST="http https" -e PACT_BROKER_DATABASE_USERNAME=pactbrokeruser -e PACT_BROKER_DATABASE_PASSWORD=TheUserPassword -e PACT_BROKER_DATABASE_HOST=postgres -e PACT_BROKER_DATABASE_NAME=pactbroker -d -p 80:80 dius/pact-broker`

priyank.shah217
2019-09-05 09:04
@bethskurrie Thanks a lot.. :pray:

kevin.monteiro
2019-09-08 12:04
has joined #pact-broker

andreas
2019-09-09 07:14
has joined #pact-broker

ckotyan
2019-09-11 16:04
has joined #pact-broker

pkuang
2019-09-12 19:39
Hi I was wondering if there are any plans/work in progress to expose a user-friendly view of the verification results on the broker. Currently clicking on the results returns the json response in the HAL browser. It would be nice to be able to view this in a UI similar to the Pact contract view

neelofer.tamboli
2019-09-12 21:57
has joined #pact-broker

bethskurrie
2019-09-12 22:24
Not yet in the OSS @pkuang. You can see them in http://pactflow.io though. It's just been released.


p0deje
2019-09-13 03:57
has joined #pact-broker

sarajcarbajal
2019-09-13 09:40
has joined #pact-broker

pkuang
2019-09-13 14:54
Thanks @bethskurrie, are there any plans on implementing this on the OSS broker? I'm weighing whether I should implement my own UI to parse the verification json and/or attempt to put up a PR to integrate it into the OSS broker

borsuk.artem034
2019-09-16 12:41
Hello, faced with issue in pact-broker when try to change version, database is external MySQL with data, when pact broker fetch webhooks got error: ```Did you mean? to_s ! Unable to load application: NoMethodError: undefined method `to_json' for {"Accept"=>"application/json"}:Hash 12:32:13.322549 D [7:47301919996420] root -- (0.000372s) SELECT * FROM `webhooks` WHERE (`id` = 9) LIMIT 1 FOR UPDATE 12:32:13.321983 D [7:47301919996420] root -- (0.000362s) SELECT * FROM `webhook_headers` FOR UPDATE 12:32:13.320723 D [7:47301919996420] root -- (0.000280s) SELECT NULL 12:32:13.321158 D [7:47301919996420] root -- (0.000303s) SELECT NULL AS `nil` FROM `webhook_headers` LIMIT 1 12:32:13.321588 D [7:47301919996420] root -- (0.000271s) SELECT NULL 12:32:13.320312 D [7:47301919996420] root -- (0.000335s) SELECT NULL AS `nil` FROM `webhook_headers` LIMIT 1 2019-09-16 12:32:13.319882 D [7:47301919996420] root -- (0.000276s) SELECT NULL 2019-09-16 12:32:13.319410 D [7:47301919996420] root -- (0.000483s) DESCRIBE `webhook_headers` ``` downgrade versions give the same result. Anybody have the same? or can help?


lauri.vaeaenaenen
2019-09-16 16:08
has joined #pact-broker

detert
2019-09-18 10:16
Hi there. What is the proper way to call `pact-broker can-i-deploy` in the way that only those pact versions are checked that are tagged with a specific tag, for both pacticipants? I currently use `./pact-broker can-i-deploy -a myconsumer -l master -b http://mybroker` but it fails, because there is one untagged provider version which did not succeed the test so far

detert
2019-09-18 10:16
To me more clear: It is enough for me to check the last master-master pairs

bethskurrie
2019-09-18 10:22
I don't understand the problem I'm afraid.

bethskurrie
2019-09-18 10:23
Can you paste the command and output?

detert
2019-09-18 10:25
Alright. As you can see, the latest provider version that is tagged as master is green. However, can-i-deploy fails, because the one version that is not tagged as master is red. I want to check only those pacts that are labeled as master

bethskurrie
2019-09-18 10:26
What's the output of can I deploy?

bethskurrie
2019-09-18 10:26
I can't see what that version would matter.

detert
2019-09-18 10:26
./scripts/pact/bin/pact-broker can-i-deploy -a bookingengine.mietwagen -l master -b https://pact-broker ``` CONSUMER | C.VERSION | PROVIDER | P.VERSION | SUCCESS? ------------------------|--------------------------------|-------------------------------|--------------------------------|--------- bookingengine.mietwagen | 1.0.0-adf757b0aff78c2910e4c... | bookingengine.customerprofile | 1.0.0-bd6e7f008aeedd30f65e6... | true bookingengine.mietwagen | 1.0.0-adf757b0aff78c2910e4c... | bookingengine.pci | 1.0.0-715595c410379f10b8972... | false ```

bethskurrie
2019-09-18 10:27
BTW, the command you're using there is saying "I want to deploy the latest version of the consumer that has the master tag with the latest version of everything else".

bethskurrie
2019-09-18 10:28
I think you're missing "--to master"

detert
2019-09-18 10:28
Yeah, maybe I do it wrong. That why I am asking. I found it difficult to understand the docs to be honest.

bethskurrie
2019-09-18 10:29
Then it will be saying, I want to deploy the latest version of the consumer with the tag master, to an environment that has the latest master version of everything else.

detert
2019-09-18 10:31
Alright. This is the output for the latest version of bookingengine.mietwagen ./scripts/pact/bin/pact-broker can-i-deploy -a bookingengine.mietwagen -e 1.0.0-adf757b0aff78c2910e4c2a34d8e536b767a3aaf --to master -b https://pact-broker Is that line correct? If yes, why does it check customerprofile with pci? I would not expect that ``` CONSUMER | C.VERSION | PROVIDER | P.VERSION | SUCCESS? ------------------------------|--------------------------------|-------------------------------|--------------------------------|--------- bookingengine.customerprofile | 1.0.0-bd6e7f008aeedd30f65e6... | bookingengine.pci | 1.0.0-171dc6e439031d55cce09... | true bookingengine.mietwagen | 1.0.0-adf757b0aff78c2910e4c... | bookingengine.customerprofile | 1.0.0-bd6e7f008aeedd30f65e6... | true bookingengine.mietwagen | 1.0.0-adf757b0aff78c2910e4c... | bookingengine.pci | 1.0.0-171dc6e439031d55cce09... | true ```

bethskurrie
2019-09-18 10:31
It's confusing me because typically your tags for deployment would reflect an environment name.

bethskurrie
2019-09-18 10:32
When you're using tags for dev, they map to a branch, but for deployment, they map to an environment.

bethskurrie
2019-09-18 10:32
You can't deploy to master.

bethskurrie
2019-09-18 10:32
The version already is on master.

detert
2019-09-18 10:32
master=prod here. Everything that we merge into master goes to production. I just use the branch name to simplify the usage and testing of feature branches

bethskurrie
2019-09-18 10:33
So you'd need to do this check before you merged to master?

detert
2019-09-18 10:34
Well. Yes. I tried to implement that check before a branch is merged into master and right before master would be deployed to production

bethskurrie
2019-09-18 10:35
Ah, so there is a gap between merging into master and then deploying to prod?

bethskurrie
2019-09-18 10:36
I still think you need to use a prod tag.

detert
2019-09-18 10:37
Well, the gap is just a few minutes but there might be merge conflicts. What is the difference between naming the tag master or prod? We consider everything in master as "this is on production"

bethskurrie
2019-09-18 10:39
It's probably OK. I'm just getting my head around it. And it makes the can I deploy line unusual.

bethskurrie
2019-09-18 10:39
I can't see the text of your commands for some reason.

bethskurrie
2019-09-18 10:39
It's white for me. On a white background.

bethskurrie
2019-09-18 10:40
I can only briefly see it if I highlight it.

bethskurrie
2019-09-18 10:40
You said something about it bringing in a dependency you didn't expect.

detert
2019-09-18 10:41
I see. What I do is tagging each pact with the current branch name. Then I want to test if all consumer/provider pairs with the same tag are green. If yes, then my master release or feature branch is good. Does that make sense?

bethskurrie
2019-09-18 10:41
Yes.

detert
2019-09-18 10:41
Great. I just do not know, if and how I have to use can-i-deploy for that use case

bethskurrie
2019-09-18 10:42
Usually you'd deploy to prod, tag with prod, and then for the next deployment, you'd say, can I deploy this new version with all the other prod versions.

bethskurrie
2019-09-18 10:42
I can't help you with your command until I can see the text unfortunately.

detert
2019-09-18 10:42
Ah I see. That's why he checks all the master versions

detert
2019-09-18 10:42
Which text do you mean?


bethskurrie
2019-09-18 10:43
Whatever is in that.

bethskurrie
2019-09-18 10:44
I can only see a bit white space after "would not expect that".

detert
2019-09-18 10:44
That is the output of the pact-broker can-i-deploy call `./scripts/pact/bin/pact-broker can-i-deploy -a bookingengine.mietwagen -e 1.0.0-adf757b0aff78c2910e4c2a34d8e536b767a3aaf --to master -b https://pact-broker`

bethskurrie
2019-09-18 10:44
See if you can strip all formatting before pasting it.

bethskurrie
2019-09-18 10:44
That command looks right though, according to what you've told me.

detert
2019-09-18 10:46
Formatting is difficult As you said: This command tests all the pacts that are tagged as master. However, if I deploy service A, I do not care about the status of the consumer/provider pair from service B and C, I am interested in A/B and A/C, but not B/C

bethskurrie
2019-09-18 10:47
Ah, do you have a 3 way dependency tree?

bethskurrie
2019-09-18 10:48
And an older version of the broker?

detert
2019-09-18 10:48
In the given case, I want to deploy service A. A cosnumes B and C. B does consume C as well. But the conenction from B to C is irrelevant, if I want to release A

bethskurrie
2019-09-18 10:49
Hang on a tick

detert
2019-09-18 10:49
I use pact-1.66.0-linux-x86_64.tar.gz


bethskurrie
2019-09-18 10:49
Broker version

bethskurrie
2019-09-18 10:50
There was a bug where the other dependency was being returned, but it's been fixed.

bethskurrie
2019-09-18 10:50
Just trying to find it

detert
2019-09-18 10:50
Does the web interface display the version somewhere?

bethskurrie
2019-09-18 10:51
It's in the headers

bethskurrie
2019-09-18 10:51
Open the Hal browser

detert
2019-09-18 10:52
2.29.0

detert
2019-09-18 10:52
X-Pact-Broker-Version


bethskurrie
2019-09-18 10:55
ensure unrelated dependencies are not included in a matrix result when three pacticipants each have dependencies on each other (a086ffec)


detert
2019-09-18 10:56
Great. I will pull the latest pact-broker-docker version and see if that helps. Thank you very much

bethskurrie
2019-09-18 10:56
You're only the second person to have reported that bug in 6 years.

detert
2019-09-18 10:57
Lol. Maybe noone works like we do :smile:

bethskurrie
2019-09-18 10:58
That particular dependency graph is unusual!

detert
2019-09-18 11:03
You are right. The reason is that we are moving parts from service A to B and we are not done yet

detert
2019-09-18 12:00
The new version works like a charm. Thank you again!

guidopio.mariotti10_d
2019-09-19 07:37
has joined #pact-broker

dianaszaharia
2019-09-19 10:46
has joined #pact-broker

mohindroo.deepak
2019-09-20 17:15
How can i use can-i-deploy with PactNet consumer ? How to use in ci/cd pipeline?

matt.fellows
2019-09-21 02:35
Have you read the docs at http://docs.pact.io?

matt.fellows
2019-09-21 02:36
can-i-deploy has nothing to do with PactNet, you just need to download the CLI tools and execute them like you would any other tool

tritorto
2019-09-23 03:11
has joined #pact-broker

tritorto
2019-09-24 01:21
Hi guys, wondering if anyone can point me to any details with setting up the pact broker webhook for TeamCity integration (i.e trigger a build when the pact changes) - Im looking at the wiki webhook template library atm (https://github.com/pact-foundation/pact_broker/wiki/Webhook-template-library), but nothing on Teamcity - any help would be appreciated..


tritorto
2019-09-24 01:35
Thanks Beth - I was just looking at it :slightly_smiling_face: Im trying to send a test webhook with the XML needed in PactFlow UI - I've come up with this Body so far, but it is failing with a 400 Bad Request: Headers: ``` "Content-Type": "application/xml" ``` Body: ``` <build branchName=\"develop\"> <buildType id=\"TEST\"\/> <comment><text>New version of pact created for ${pactbroker.consumerName}/${pactbroker.providerName}.</text></comment> <properties><property name=\"env.pactVersionUrl\" value=\"$pactbroker.pactUrl\"\/><\/properties> </build> ```

matt.fellows
2019-09-24 01:38
Looks like your use of `$pactbroker.pactUrl` is missing the enclosing template braces `{`, `}`

tritorto
2019-09-24 01:40
Have added in the brackets - cheers - still giving 400 though :confused:

bethskurrie
2019-09-24 01:40
I'd personally start by writing a curl request, doing the simplest thing possible (no properties) and once that was working, move it into pactflow

tritorto
2019-09-24 01:40
yea you're right - i'll give that a go, thanks guys!

tritorto
2019-09-24 01:55
for anyone interested - I have it sending successfully now (just got to hook it up to TC :crossed_fingers:)

bethskurrie
2019-09-24 03:37
@tritorto I notice that you put the body in single quotes. You shouldn't have to do that - what were you noticing when you didn't use the quotes?

tritorto
2019-09-24 03:45
have updated it and seems to work fine without quotes @bethskurrie

samuel.hodgkinson
2019-09-24 12:43
Hi, I'm not sure I posted this in the right place. Can anyone assist me with this issue?

pkuang
2019-09-24 13:41
Hi @bethskurrie, was wondering if you had a response for my previous question?

antonello
2019-09-24 17:46
@bethskurrie We?ve noticed that even simple can-i-deploy calls for a consumer with only one provider take several seconds. We didn?t measure, but sometimes >10s. Is it expected? Is there anything we may be doing wrong?

bethskurrie
2019-09-25 02:36
It will be due to combinationatorial explosion @antonello. The most sane way to handle it is to remove old data. I did do some recent work on that query that might speed it up for you. Are you on the latest version?


bethskurrie
2019-09-25 02:40
"pact broker client issue 53"

bethskurrie
2019-09-25 02:42
If that doesn't help, maybe you'd be able to send me a redacted copy of your database so I can do some analysis on it.

antonello
2019-09-25 06:54
Thanks Beth, I?ll check when I get to the office in a bit but I?m almost certain that we are on a version greater than the one that includes that fix.

bethskurrie
2019-09-25 07:24
And you did a data clean up recently didn't you?

antonello
2019-09-25 07:26
Maybe around 6 weeks ago - I could try to clean up again.

antonello
2019-09-25 07:26
We should really make it a scheduled job

bethskurrie
2019-09-25 07:27
If you're able to get an export and blank out all the actual pact contents, I can run some analysis on it.

bethskurrie
2019-09-25 07:28
Processing power makes a big difference. On my mac, the queries for even large datasets come back super fast, but on the RDS instance for Pactflow, it was significantly slower.

bethskurrie
2019-09-25 07:28
I had to put the data in a docker container with reduced specs just to reproduce the slowness.

antonello
2019-09-25 07:39
Any recommendations on what type of CPU you?d recommend. Looking at the performance stats of the machine that hosts the broker and the DB, the CPU usage stays ~20% when running those query.

bethskurrie
2019-09-25 07:39
:thinking_face:

bethskurrie
2019-09-25 07:40
memory?

antonello
2019-09-25 07:40
However, and I wanted to mention that as well, last week someone managed to bring the broker down by running to concurrent can I deploy requests.

antonello
2019-09-25 07:40
Memory also under-utilised

bethskurrie
2019-09-25 07:40
that's v strange

bethskurrie
2019-09-25 07:46
Is it the query that takes the 10 seconds, or the http response?

bethskurrie
2019-09-25 07:46
There is some ruby post processing done on the data.

bethskurrie
2019-09-25 07:46
I wonder if it's that that's actually taking the time.

antonello
2019-09-25 07:53
Would the logs tell us?

bethskurrie
2019-09-25 08:19
Yes, if you've got debug logging on, it will log the requests and request times.

bethskurrie
2019-09-25 08:19
The SQL, that is

bethskurrie
2019-09-25 08:21
If the http request is taking 10 seconds, but the SQL is taking significantly less, that tells us where the problem is.

german.schnyder
2019-09-26 07:35
has joined #pact-broker

mohindroo.deepak
2019-09-26 16:55
Is there any sort of authentication for stop accessing pact broker site?

matt.fellows
2019-09-27 03:52
Are you hosting your own? If so no, there is no auth or permission on the OSS broker. We have a number of authentication mechanisms on Pactflow

ruben.perezg
2019-09-27 08:54
Hi! We are trying to complete the adoption of Pact, and currently what we have missing is the `can-i-deploy` functionality: - Check whether intended deploy is safe (checking the Pact Matrix with the `can-i-deploy`) - Tag with the production stage once the deploy has succeed. In our case, it would be way simpler for us if we could use the API instead of the _can-i-deploy_ CLI. I have been fighting with this, trying to find out how to do that using the API. I have found this [1] as the only point of documentation for what I am trying to do. There, there is an example that says `A request for the compatibility matrix for Foo version 1.2.3 and the latest prod versions of all other pacticipants`, that I think is exactly what I'm looking for in order to check whether the new version to deploy is safe. For that, there is this example: ``` { "method": "get", "path": "/matrix", "query": "q[][pacticipant]=Foo&q[][version]=1.2.3&latestby=cvp&latest=true&tag=prod" }``` My guess is that I have to create a `GET` request like this: `http://myPactBroker/matrix?pacticipant=myPacticipant&version=myCommitId&latestby=cvp&latest=true&tag=pro` But that is not working, as I'm getting a `400` status code, with this body: ``` { "errors": [ "Please provide 1 or more version selectors." ] }``` Could anyone point my what I'm doing wrong, or any documentation of the Broker API that I have not found? :slightly_smiling_face: 1 -> https://github.com/pact-foundation/pact_broker-client/blob/master/doc/pacts/markdown/Pact%20Broker%20Client%20-%20Pact%20Broker.md

bethskurrie
2019-09-27 08:56
Hi @ruben.perezg can you explain what's blocking you from using the cli?

ruben.perezg
2019-09-27 08:57
sure

ruben.perezg
2019-09-27 08:59
our scenario includes a Monolith with its own CI and deploy system, and Microservices, with their own CI and CD system. For our microservices, we use Spinnaker, and in our current setup I'm not sure if it's possible to execute any CLI there. But it is quite straightforward to make API requests... so that's why I am looking into using the API instead of the CLI

bethskurrie
2019-09-27 09:00
I see.

bethskurrie
2019-09-27 09:00
The query you are using doesn't match the example.

bethskurrie
2019-09-27 09:01
The q[] in the param names is important

bethskurrie
2019-09-27 09:01
q[][pacticipant]=Foo&q[][version]=1.2.3&latestby=cvp&latest=true&tag=prod

ruben.perezg
2019-09-27 09:01
I already thought that the `q[]` was important, but I haven't been able to get it right :slightly_smiling_face:


bethskurrie
2019-09-27 09:02
They don't match

bethskurrie
2019-09-27 09:03
If you run can I deploy with verbose on, you'll see the exact query it's making

ruben.perezg
2019-09-27 09:03
oh, could I do that?

bethskurrie
2019-09-27 09:04
It logs the https requests

ruben.perezg
2019-09-27 09:05
to be honest, I haven't seen this kind of query before: `"query": "q[][pacticipant]=Foo&q[][version]=1.2.3&latestby=cvp&latest=true&tag=prod"` So I was pretty lost trying to "translate" that. But if the can I deploy logs the requests, then I will try that

bethskurrie
2019-09-27 09:05
I need to abstract that api a bit more. It's a bit low level.

bethskurrie
2019-09-27 09:06
It's how you do structured data in a query string.

bethskurrie
2019-09-27 09:06
The square brackets indicate arrays and objects

bethskurrie
2019-09-27 09:07
You can just copy paste and swap the name and version of your application, and tag.

ruben.perezg
2019-09-27 09:07
then it was easier that everything that I tried... :sweat_smile:

ruben.perezg
2019-09-27 09:12
that is indeed working with a quick test directly from the browser. Thank you very much Beth! :slightly_smiling_face:

bethskurrie
2019-09-27 09:13
np.

angela.gloyna
2019-09-27 16:03
has joined #pact-broker

mohindroo.deepak
2019-09-27 19:57
That is interesting. So we do not need canideploy tool to verify consumer pacts by using above urls?

bethskurrie
2019-09-29 23:33
You can call the API directly, but it's not very user friendly. I need to abstract some of the logic in a "can i deploy" endpoint. At the moment, it's calling the matrix endpoint with specific parameters.

catrionamcgarvey
2019-09-30 08:34
has joined #pact-broker

borsuk.artem034
2019-09-30 10:39
Hello, can some one give example how to use OAuth in webhook for bitbuket?

bethskurrie
2019-09-30 10:41
I don't think it will possible from the broker side, because you only get one request, and as far as I know, oauth requires a multi step flow.

bethskurrie
2019-09-30 10:42
I've always understood oauth to be a user auth mechanism, rather than a machine to machine auth mechanism. Is there another way of authenticating to bit bucket?

borsuk.artem034
2019-09-30 10:46
you are right, try check app password

mohindroo.deepak
2019-09-30 16:17
I was trying to run can-i-deploy tool to check consumer pact veriifcation. My broker is using certificate. It fails with certicate_verification_fail error. Any clue?

mohindroo.deepak
2019-09-30 16:32
Self signed certificate

mohindroo.deepak
2019-09-30 16:32
Actual error Error: Error making request - OpenSSL::SSL::SSLError SSL_connect returned=1 errno=0 state=error: certificate verify failed

bethskurrie
2019-10-01 00:01
@mohindroo.deepak `To connect to a Pact Broker that uses custom SSL cerificates, set the environment variable $SSL_CERT_FILE or $SSL_CERT_DIR to a path that contains the appropriate certificate.`


bethskurrie
2019-10-01 00:03
Hey all, does anyone use the network diagram (either directly, or by exporting the integrations data into another tool)?

abubics
2019-10-01 00:21
I used to, but didn't find it super helpful on my small networks :stuck_out_tongue:

abubics
2019-10-01 00:21
I do like jumping to the contract for a pair of pacticipants, though

bethskurrie
2019-10-01 00:40
Glad we bring you some small joy in your life.

mohindroo.deepak
2019-10-01 04:45
I have set this environment variable in powershell before calling can-i-deploy command but it did not work. Only difference is that my certificate extension is .cer not .crt.

mohindroo.deepak
2019-10-01 04:45
Not sure if that makes the difference

tritorto
2019-10-01 05:19
exporting it into Powerpoint :wink: - I really like the feature actually :+1:

tritorto
2019-10-01 05:24
Hey guys - first off absolutely loving the pact-broker / pactflow - our team has started using it and so far so good :slightly_smiling_face: a quick question however, with regards to webhook integration - I was thinking of adding a webhook to post verification results to Slack - I noticed in the webhook template documentation, we are only able to use the verification result url, and not the actual status value - is this correct? Would be nice to display the result directly in Slack

bethskurrie
2019-10-01 05:26
Thanks @tritorto! No, the status value is also available.

bethskurrie
2019-10-01 05:26
Perhaps the documentation is missing it. Which page are you looking at?


bethskurrie
2019-10-01 05:28
`${pactbroker.githubVerificationStatus}: the verification status using the correct keywords for posting to the the Github commit status API.`

bethskurrie
2019-10-01 05:28
Use that one.

tritorto
2019-10-01 05:29
perfect! thanks :slightly_smiling_face:

mohindroo.deepak
2019-10-01 05:34
Yes we are also started using that and absolutely great feature :+1:

mohindroo.deepak
2019-10-01 06:45
Any thought on this

bethskurrie
2019-10-01 06:45
Powershell, hey.. I think there was an issue with windows. Let me see if I can find the issue on github.


mohindroo.deepak
2019-10-01 06:50
Ok thanks

mohindroo.deepak
2019-10-01 06:56
Its not confirmed that this issue resolved in windows?

bethskurrie
2019-10-01 06:57
It's not fixed - I don't have a windows environment to test on, and nobody was able to verify a code fix from my suggestions. There's just that workaround.

mohindroo.deepak
2019-10-01 06:57
I will try to overwrite my certificate and see if that wirks

mohindroo.deepak
2019-10-01 06:57
.cer files will not work?

bethskurrie
2019-10-01 06:58
I don't know. I'd stick with the same format personally. But it doesn't hurt to try.

bethskurrie
2019-10-01 06:58
I still think that `set "ORIG_SSL_CERT_FILE=%SSL_CERT_FILE" to pact-provider-verifier.bat` in should work.

bethskurrie
2019-10-01 06:58
But as I said, I don't have a windows machine.

mohindroo.deepak
2019-10-01 06:59
I am using pact-broker.bat file

mohindroo.deepak
2019-10-01 06:59
To use can-i-deploy

mohindroo.deepak
2019-10-01 07:13
I have actually replaced my certificate file with lib\ruby/lib/ca-bundle.cry

mohindroo.deepak
2019-10-01 07:13
Crt

mohindroo.deepak
2019-10-01 07:13
But still same error

bethskurrie
2019-10-01 07:13
Can you try using the cert file with a native powershell tool?

bethskurrie
2019-10-01 07:14
Didn't you get this working with pact-net already?

bethskurrie
2019-10-01 07:15
How are you publishing pact files now?

mohindroo.deepak
2019-10-01 07:15
Publishing pct files using pactnet

bethskurrie
2019-10-01 07:16
I thought it used the underlying pact broker client code to publish the pacts. but perhaps not.

mohindroo.deepak
2019-10-01 07:16
Well that part working fine

mohindroo.deepak
2019-10-01 07:16
Only that cli tool giving issue

bethskurrie
2019-10-01 07:17
It must not be verifying ssl then :thinking_face:

bethskurrie
2019-10-01 07:18
I'll see if I can give you an easy API to call directly.

bethskurrie
2019-10-01 07:18
I had something thrown together, but I hadn't finished the validation.

mohindroo.deepak
2019-10-01 07:18
That will be great if i can get some api. This is required at consumer side to validate

mohindroo.deepak
2019-10-01 07:19
Can i deploy the build or not

borsuk.artem034
2019-10-01 08:08
work with bitbucket app password

pltran875
2019-10-01 16:04
I am receiving 429 status code too many requests when publishing up to 3 contracts in a row - is there a limit? thanks.

mohindroo.deepak
2019-10-01 16:36
Currently i have disabled the authentication and open 80 port

mohindroo.deepak
2019-10-01 16:36
And it started working

mohindroo.deepak
2019-10-01 16:37
So definitely there is some issue on windows pact

bethskurrie
2019-10-01 22:43
Hi @pltran875, if you're on the free plan, then yes.


angela.gloyna
2019-10-01 23:46
Hi, I might be completely overlooking something, but I'm having trouble tagging provider versions in pact-broker (docker image). hitting this endpoint has been returning 404: `https://{pact_broker_url}/pacticipants/{provider}/versions/{version}/tags/prod`

angela.gloyna
2019-10-01 23:53
... and by asking for help, I just figured out the body needs to include the provider, version, and tags. Resolved!

matt.fellows
2019-10-02 00:04
:duck:

matt.fellows
2019-10-02 00:04
:point_up: rubber duck (closest we had in emojis)

bethskurrie
2019-10-02 00:40
Does it?

bethskurrie
2019-10-02 00:40
For a get?

bethskurrie
2019-10-02 00:40
Or a put?

bethskurrie
2019-10-02 00:41
That url looks fine. To tag a resource you just need to do a put to that url.

bethskurrie
2019-10-02 00:41
It does need a content type set, perhaps that's it.

angela.gloyna
2019-10-02 01:32
It was a put. Didn?t seem to work via postman until I reiterated the parameters in the body.

angela.gloyna
2019-10-02 01:36
just retried it without the content-type. that was the culprit. Thanks for the quick response!

bethskurrie
2019-10-02 01:39
:+1:

pltran875
2019-10-02 09:08
No prob. Thanks I'm still evaluating at this stage

pltran875
2019-10-02 11:17
Does this include the DiUS versions

nayaksurajr
2019-10-02 16:00
has joined #pact-broker

bethskurrie
2019-10-02 20:25
The example data? No, it's not included in the count.

g.maguire85
2019-10-02 22:46
has joined #pact-broker

g.maguire85
2019-10-02 22:58
on OSS pact broker is there to enable only a read/write basic auth user say for a CI system to have write access for publishing pacts. Then just leaving pact broker open with read access with no user auth prompt?

bethskurrie
2019-10-02 23:23
Not currently, but it wouldn't be hard to do.


bethskurrie
2019-10-02 23:27
Actually, now I think about it, if you didn't set the env vars for the read only username and password, it might give you public read access. Try it and see what happens @g.maguire85

rootuid
2019-10-03 08:53
has joined #pact-broker

pltran875
2019-10-03 09:48
So I originally signed up and am using the DiUS Hosted Pact Broker public beta version (before Pactflow) - just to clarify are there any limitations or plans to eventually discontinue that we should be aware of?

bethskurrie
2019-10-03 10:21
There was a migration issue where limits were accidentally applied to the beta users, but that has been fixed.

bethskurrie
2019-10-03 10:22
Whether or not the free version will continue indefinitely is not yet decided.

g.maguire85
2019-10-03 16:17
@bethskurrie - so if you dont set the read only env vars, you are still presented with the prompt. though you can access the app by just clicking sign-in without entering any creds

bethskurrie
2019-10-04 00:04
Ok. It shouldn't be hard to fix.

mohindroo.deepak
2019-10-04 12:00
Some strange issue coming in pact-broker.bat can-i-deploy

mohindroo.deepak
2019-10-04 12:00
Errno:rtimedout

mohindroo.deepak
2019-10-04 12:00
It was working fine till now but suddenly getting failed

mohindroo.deepak
2019-10-04 12:34
It works now. There was some firewall block

g.maguire85
2019-10-04 15:24
ok cool

bethskurrie
2019-10-06 23:45
@mohindroo.deepak are you using Pactflow or your own local Pact Broker?

bethskurrie
2019-10-06 23:46
@g.maguire85 I've updated the code to not present a basic auth prompt when the read creds are empty

bethskurrie
2019-10-06 23:46
just need to release the docker container

jack.middleton
2019-10-07 13:43
has joined #pact-broker

sabino_lrs
2019-10-07 16:46
has joined #pact-broker

mohindroo.deepak
2019-10-07 17:22
Own local pact broker

yosevuk
2019-10-07 18:26
has joined #pact-broker

yosevuk
2019-10-07 18:27
Hello! I have a question about when to use `pactBrokerUrl` versus `pactUrls` when setting up provider [verification options](https://github.com/pact-foundation/pact-js#verification-options). Are you supposed to use `pactUrls` when you have a provider with more than one consumer pact broker URLs that you want to be able to verify independently?


bethskurrie
2019-10-08 03:09
@gopinathlangote11 released

gopinathlangote11
2019-10-08 11:02
Great. I will take a look

pkuang
2019-10-08 15:22
Hi, is it possible to self host the PactFlow UI of the broker?

g.maguire85
2019-10-08 17:40
@bethskurrie - thanks i will check it out and report back

pravera
2019-10-08 19:28
Hi! In the docs it says `The latest production pact for provider Bar can then be retrieved from /pacts/provider/Bar/consumer/Foo/latest/prod.` after tagging it as `/prod`. But whenever I tag the version and then retrieve it, `/latest/tag` I?m getting an old app version. Any thoughts? https://github.com/pact-foundation/pact_broker/wiki/Using-tags

uglyog
2019-10-08 22:29
Not currently, as it is tied to the Pactflow service and is part of a commercial offering

uglyog
2019-10-08 22:29
But we are looking at supporting on-prem and self-hosted versions of Pactflow

tjones
2019-10-08 22:30
What are the versions, and when were they published? It might be that the broker thinks that the older version is more recent

tmok01842
2019-10-09 00:23
has joined #pact-broker

tmok01842
2019-10-09 00:23
Hi all - I've got an error to report. My company has a pact broker account and when people are attempting to view the matrices they're getting 'internal server error'

bethskurrie
2019-10-09 00:26
Hi @tom397 I'll have a look for you

tmok01842
2019-10-09 00:27
thanks @bethskurrie. If you need the company name/url let me know

bethskurrie
2019-10-09 00:27
Yes, please pm it to me.

bethskurrie
2019-10-09 01:15
@tmok01842 that fix is out.

tmok01842
2019-10-09 01:16
Thanks @bethskurrie! Much appreciated

bethskurrie
2019-10-09 01:17
Btw, you're still on the beta offering. We've released the official Pactflow product now, which has some extra goodies including display of line level verification results, secrets, webhook testing and editing https://pactflow.io/oss/

bethskurrie
2019-10-09 01:17
Also, a much better UI!

tmok01842
2019-10-09 01:18
that looks good - but what's the status of our license etc w.r.t. this new product?

bethskurrie
2019-10-09 01:19
You're able stay on your current free beta plan for now. We haven't decided how long that will run for yet, now the official release is out.

bethskurrie
2019-10-09 01:19
Beta customers will get a discount if they want to move over to a paid plan however.

bethskurrie
2019-10-09 01:20
As a thanks for being early adopters of our product!

tmok01842
2019-10-09 01:21
Ok. We may well do so. We're right on the cusp of beginning to try to use PB in anger for all our applications. If it works out ok, we'll probably want to move to the official product sooner or later

bethskurrie
2019-10-09 01:21
:thumbsup::skin-tone-3:

bethskurrie
2019-10-09 01:21
Give us a yell at if you need any help or have questions.

tmok01842
2019-10-09 01:22
Thanks - will do

tony.ibbs
2019-10-09 09:33
has joined #pact-broker

pravera
2019-10-09 13:35
Hi @tjones thanks for the answer! The versions are `APP_VERSION.BUILD_NUMBER`, say `2.0.0.123`. We have `order_by_date setting=true` now, so it should be ordering by the versions. But it?s only considering `X.X.X` and not the BUILD_NUMBER when ordering, so when that changes, we still can?t get the latest pact.

vitaliy.grigoruk
2019-10-09 14:24
Hey folk, is there any practice regarding cleanup of old participant versions, tags in pact broker?

yosevuk
2019-10-09 14:25
Hey! I have a question about pact verification for the provider after reading: https://docs.pact.io/getting_started/verifying_pacts#verifying-pacts-from-a-pact-broker. Once a pact is published and I see it in the pact-broker, what has to happen for it to be verified? I assume that the team responsible for the provider service has to make updates on the provider side to verify the new consumer pact. Is that accurate?

antonello
2019-10-09 14:51
Yes, you or someone else need to write some provider verification tests.

david862
2019-10-09 15:38
has joined #pact-broker

pravera
2019-10-09 17:34
Is this going to be implemented at some point? https://github.com/pact-foundation/pact_broker/issues/175 cause if we want to follow the pact nirvana guides, and the best practices in the `app_version` form (using build number or git sha) for now it does not change anything right? As having `PACT_BROKER_ORDER_VERSIONS_BY_DATE=false` to order by semantic version will only consider `X.X.X` part of the version and not the change in the build number or git sha

mauricio.galeas
2019-10-09 17:57
has joined #pact-broker

mauricio.galeas
2019-10-09 18:33
Hell! I have a question. I'm using a hosted pact-broker in go, but when i execute the test it crashes in the same part `=== RUN TestProvider` `2019/10/09 15:31:46 [ERROR] service exec: "pact-broker": executable file not found in $PATH` `--- PASS: TestProvider (0.11s)` Did i miss to install something?

mauricio.galeas
2019-10-09 18:53
Does anybody here worked with a hosted pact-broker?

bethskurrie
2019-10-09 21:55
Given that its a local path issue, I can't see that it makes a difference where the pact broker is running @mauricio.galeas?

bethskurrie
2019-10-09 21:56
Ordering is done by date now. Semantic parsing is deprecated @pravera

bethskurrie
2019-10-09 21:57
Set that env var to true.

bethskurrie
2019-10-09 21:58
I've been meaning to add this to the code, but for now, there's an SQL script in the pact broker repo @vitaliy.grigoruk


mauricio.galeas
2019-10-09 22:16
ok, i got it

bethskurrie
2019-10-09 22:17
@pravera it does the ordering on insert, so after you change that setting, you'll need to publish another pact for it to redo the ordering.

pravera
2019-10-10 00:18
Thanks for the response! @bethskurrie I?ve set it back to `true`. We?re using `app_version.build_number` to tag consumer versions so when pushing multiple changes, the versions are `1.0.0.1234`, `1.0.0.1235` and then `1.0.0.1236` . Each version is tagged with `branch_name`, but the `/latest/branch_name` we retrieve is always the pact corresponding to `1.0.0.1234`. The pacts (with changes) for the other ones can?t be retrieved by `latest/branch_name` . Is this the expected behaviour?

matt.fellows
2019-10-10 01:45
Thanks Beth. It was x-posted to #pact-go and was sorted.

vitaliy.grigoruk
2019-10-10 07:16
let me please clarify your question, @yosevuk. Are you interested in ?how to trigger provider verification when contract is published? or ?how provider team should implement verification process on their side?

dannybrown2710
2019-10-10 10:37
has joined #pact-broker

dannybrown2710
2019-10-10 10:39
Hi Team, I need help. I want to setup the pact broker in Pivotal cloud foundry and use Oracle as database in certain tablespace . I am new to Ruby and I am not able to proceed. Can someone give me steps to set it up ? Thanks in advance

matt.fellows
2019-10-10 10:52
We only support (test for) Postgres and MySQL, so it's likely this setup isn't possible

dannybrown2710
2019-10-10 10:52
even in example folder?

matt.fellows
2019-10-10 10:53
What do you mean, sorry?

matt.fellows
2019-10-10 10:53
Oracle is not supported full stop

yosevuk
2019-10-10 16:51
"How to trigger the provider verification when the contract is published". If there is already a provider with tests, does it need to do anything to verify a pact with a new consumer or should that happen automatically when the new pact is published? Perhaps it depends on how the provider is set up :thinking_face:

pravera
2019-10-10 17:03
I would really appreciate some help with this, as it?s been an actual blocker

bethskurrie
2019-10-10 20:14
@pravera try deleting all the pacts through the UI and start again.

bethskurrie
2019-10-10 20:15
I've heard of issues before when people have changed versioning approaches mid way.

bethskurrie
2019-10-10 20:17
@dannybrown2710 the example folder uses Sqlite, which is not a production database.

bethskurrie
2019-10-10 20:18
If you are unfamiliar with running Ruby applications, please use the docker image pactfoundation/pact-broker or get a hosted broker at http://pactflow.io. We cannot assist you with a custom deployment. That is the job of a (paid) ops person.

pravera
2019-10-10 20:19
Thanks! We have 19 consumers with their providers being tested using the pact-broker, so if the approach is to delete all of them, builds will start to fail. This makes me think of the need to have a backup or a way to do this gracefully.



bethskurrie
2019-10-10 20:21
No - just delete and re run the consumer

bethskurrie
2019-10-10 20:22
Unless you have production tags, it will just repopulate.

bethskurrie
2019-10-10 20:23
I'm assuming you've restarted the broker after making the configuration change?

bethskurrie
2019-10-10 20:23
You could try deleting just the problem pact.

bethskurrie
2019-10-10 20:26
BTW, what version of the broker are you using? The semantic ordering has been not on by default for ages.

pravera
2019-10-10 20:31
Indeed, deployed the broker with the new config change. Will try that, and also publishing pacts for other services and try to retrieve them with `latest/branch_name`. We?re using 2.15.0 version

pravera
2019-10-10 21:20
Tried deleting the consumer with all of the pacts and published two different pacts with `/develop` tag and versions: `X.X.X+1111` and `X.X.X+1112` but still `latest/develop` returns pact from `X.X.X+1111'

bethskurrie
2019-10-10 21:20
I do not know what's going on with your instance!

bethskurrie
2019-10-10 21:21
It will return whichever is the latest one

bethskurrie
2019-10-10 21:21
as in, time based

bethskurrie
2019-10-10 21:21
what order did you publish them in?

bethskurrie
2019-10-10 21:22
2.15.0 is quite old btw

bethskurrie
2019-10-10 21:22
perhaps date ordering isn't supported in that one.

pravera
2019-10-10 21:23
createdAt: `X.X.X+1111` ?2019-10-10T21:13:24+00:00? `X.X.X+1112` ?2019-10-10T21:14:08+00:00"

bethskurrie
2019-10-10 21:23
I'm just trawling the changelog

pravera
2019-10-10 21:23
Im going to check the changelog until now then

bethskurrie
2019-10-10 21:23
docker version?

bethskurrie
2019-10-10 21:24
either way, it would be best to upgrade, because there are known vulnerabilities with the webhooks in older versions

bethskurrie
2019-10-10 21:24
and you don't get the UI to delete pacts in that version.

bethskurrie
2019-10-10 21:24
### v2.23.0 (2018-06-20)

bethskurrie
2019-10-10 21:24
* change version ordering to sort by date by default ([6552b46](/../../commit/6552b46))

bethskurrie
2019-10-10 21:25
though, if the property exists, it should be supported.

bethskurrie
2019-10-10 21:25
I think the answer, either way, is please upgrade.

pravera
2019-10-10 21:28
Cool I?m headed to that changelog and check to upgrade the version. In case the default was being false in this version, I tried before to set `PACT_BROKER_ORDER_VERSIONS_BY_DATE=true`. To delete in this version had to delete the pacticipant, which in this case was only consumer so no problem.

bethskurrie
2019-10-11 00:38
@g.maguire85 an issue was raised which lead me to realise there was potential for a security vulnerability if the READ_ONLY credentials weren't set. I've changed the latest docker images to require an explicit enabling of public read.

dannybrown2710
2019-10-11 06:43
Sure. I will look into it. Thanks alot for your help :slightly_smiling_face:

detert
2019-10-11 07:37
When using pact-broker webhooks with GitLab, I have to add a GitLab Token to the according URL. Is there a way to hide that token? It should not be visible for everyone.

bethskurrie
2019-10-11 08:12
OSS Pact Broker @detert?

bethskurrie
2019-10-11 08:12
http://pactflow.io has secrets


bethskurrie
2019-10-11 08:13
There was some work done to redact the tokens in the logs. I'll see if that can be revived.

bethskurrie
2019-10-11 08:13
Best if you can scope the token with the least possible permissions in the meantime.

detert
2019-10-11 08:14
Do the logs affect the HAL browser as well? I guess it is possible to take a look at all webhooks via REST I think there was a possibility to add credentials to pact-broker to limit the access. Is that right?

bethskurrie
2019-10-11 08:15
There's no limits on read at the moment.

bethskurrie
2019-10-11 08:15
Oh, sorry, yes, if you're using the docker image, it's got built in basic auth

bethskurrie
2019-10-11 08:16
One read set of creds, one write set of creds.

detert
2019-10-11 08:17
That should help. I'll take a look at it. Thank you :slightly_smiling_face:

bethskurrie
2019-10-11 08:17
np

ryan.dens
2019-10-11 13:50
has joined #pact-broker

pravera
2019-10-11 20:34
Updated from broker version `2.15.0` to the latest version and now the behavior is the expected! Now after each build publishes and generates pacts with consumer version: `1.2.3-12345` and tags `/branch_name`, which we can properly retrieve and verify with `/latest/branch_name`. Thank you @bethskurrie! It?s good to know there?s a community here willing to help :slightly_smiling_face:

bethskurrie
2019-10-13 22:22
Good to hear @pravera!

darragh.grace
2019-10-14 11:10
has joined #pact-broker

darragh.grace
2019-10-14 11:18
Hi there, I am trying to figure out if I can specify a schema to use in a Postgres DB for the Pact Broker. When running the Dockerised Broker I can specify `PACT_BROKER_DATABASE_NAME`, is there functionality to specify the schema in that DB to use?


yosevuk
2019-10-16 19:47
Hello! I'm not sure if I should be asking here, but wondering: How do I use the `can-i-deploy` script in pact-node CLI if there isn't a basic auth username and password set up with the pact broker?

detert
2019-10-17 06:08
just ignore the username and password arguments


yosevuk
2019-10-17 13:56
Yeah, it doesn't work ignoring them, but I'll ask in an issue pact-node. Thanks!

jennifer.molis
2019-10-18 16:04
has joined #pact-broker

me_pact
2019-10-20 17:15
has joined #pact-broker

me_pact
2019-10-20 17:18
Hi! A question about the `/pacts/provider/{{provider}}/consumer/{{consumer}}/tag/{{tag}}` endpoint. This endpoint currently returns the pacts with versions, and a field called "createdAt". This field, however, has the initial creation date of the version, when the version has multiple revisions. To get the latest updated version, I need to query `/pacts/provider/{{provider}}/consumer/{{consumer}}/version/{{version}}` for each of the returned results. Would it be possible to add "updatedAt" field to this endpoint so that we can reduce the amount of API calls?

james.hattersley-dyke
2019-10-21 07:49
Hi, does anyone have any examples of what to `POST` to this end point in a webhook? `https://pactbroker.management.mydomain.net/webhooks/xFISu7ec7SfGYCDssjVt1g/execute` I've set up the webhook, but whenever I come to trigger it using a non-get request there's an empty post body waiting to be filled in. Do I need a payload or; is whatever is configured at setup time e.g. events, consumer and provider names etc enough to trigger the webhook?

bethskurrie
2019-10-21 08:31
Just send an empty body


bethskurrie
2019-10-21 08:34
@me_pact i know from the other conversation you're doing something unusual. Can you tell me what you're trying to achieve?

james.hattersley-dyke
2019-10-21 08:42
:+1: cool, wasn't sure. I was looking for something staring me in the face saying / demo'ing that... :slightly_smiling_face:

james.hattersley-dyke
2019-10-21 08:43
while I've got your attention, sorry have you ever had to deal with Jenkins CSRF crumbs with webhooks?

bethskurrie
2019-10-21 08:43
It's just a generic API browser - it doesn't know whether the endpoint takes a payload or not

bethskurrie
2019-10-21 08:43
Yes, can't be done.

bethskurrie
2019-10-21 08:43
There was some alternative approach.

bethskurrie
2019-10-21 08:44
I can't remember exactly.

james.hattersley-dyke
2019-10-21 08:45
no worries, I think it's more of an issue with the way we have Jenkins set up here using the 'bitbucket branch source' plugin

james.hattersley-dyke
2019-10-21 08:46
it creates multi branch projects by default, which can't use an API token, so have to use the crumbIssuer

bethskurrie
2019-10-21 08:46
Tricky

james.hattersley-dyke
2019-10-21 08:57
yeah - Ideally I'd like the consumer builds to create the webhooks too at build time. It'd check the existence first then, create if a webhook didn't exist. We've got shared pipeline libraries to contend with too so there's a node pipeline, java pipeline etc... each project just uses those base pipelines rather than having an individual jenkins file

james.hattersley-dyke
2019-10-21 08:57
it's quite a niche problem


james.hattersley-dyke
2019-10-21 08:58
yes!

james.hattersley-dyke
2019-10-21 08:59
I don't mind the delete and recreate right now, it's all this battling with API keys / crumbs etc

bethskurrie
2019-10-21 08:59
:disappointed:

bethskurrie
2019-10-21 08:59
Yeah, that's a pain.

bethskurrie
2019-10-21 08:59
In the past, I've recommended putting in a proxy that could handle the CSRF stuff.

james.hattersley-dyke
2019-10-21 09:00
yeah, we could do that. I think personally it would be safe to turn off CSRF protection in Jenkins as it's all in a VPC controlled by AWs security groups etc

bethskurrie
2019-10-21 09:01
sounds reasonable to me

bethskurrie
2019-10-21 09:01
I am not a security person however!

james.hattersley-dyke
2019-10-21 09:01
no me neither, nor do my aws skills extend to understanding the devops chap's terraform code :slightly_smiling_face:

james.hattersley-dyke
2019-10-21 09:31
Think I've cracked it, discovered all the users in Jenkins aren't config as code and can have their own API tokens configured

james.hattersley-dyke
2019-10-21 09:31
so have created a pact user with an API token

bethskurrie
2019-10-21 09:31
fingers crossed!

james.hattersley-dyke
2019-10-21 09:31
yeah i've triggered a build remotely through postman so should be all good!

james.hattersley-dyke
2019-10-21 09:32
calling Jenkins directly

bethskurrie
2019-10-21 09:32
:thumbsup::skin-tone-3:

james.hattersley-dyke
2019-10-21 09:32
1 more thing, the variable replacements

james.hattersley-dyke
2019-10-21 09:33
I'm calling jenkins with something like `/myjob/buildWithParameters?service=my-provider`

james.hattersley-dyke
2019-10-21 09:34
could I create one generic webhook, at a top level which uses the variable subsitutions so it would be configured like `/myjob/buildWithParameters?service=${pactbroker.providerName}`

bethskurrie
2019-10-21 09:34
yes

james.hattersley-dyke
2019-10-21 09:35
i bloody love pact broker

james.hattersley-dyke
2019-10-21 09:35
:smile:

bethskurrie
2019-10-21 09:35
That's nice to hear!

bethskurrie
2019-10-21 09:35
We usually just hear when there are problems :stuck_out_tongue:

james.hattersley-dyke
2019-10-21 09:38
Never really had a problem... mainly just questions :slightly_smiling_face:

me_pact
2019-10-21 15:14
So, I'm building a Concourse CI Pact resource type. [1] In summary, the resource tries to pull new versions from the source provider when invoked, which in this case it's the Pact Broker. The question it needs to answer is "Given provider X, consumer(s) Y, and tag Z, are there any new unverified Pacts?". In my use case, when I open a PR for the consumer side, and the CI runs the consumer tests, I'd like to invoke the provider and run the Pact tests. In order to do this, I have set up a webhook for the broker to invoke the Concourse resource on the provider side, and tell it to pull and find a new version. So far, this works nice with immutable Pact versions and the first endpoint that I mentioned above. However, since I can't obtain the time of the latest overwritten version through the first endpoint, I have to loop through all returned results, and query each one of them to get the `createdAt` time. In order to make a unique enough version in the Concourse resource, so that it can distinguish between versions, I have chosen a combination of `consumer`, `consumerVersion`, and the `createdAt` field. It's a convention at our company to name and overwrite the PR artifacts with the PR number on updates, that's why I would like to apply this to Pact as well. I know that this can be circumvented by appending Git hash at the end of the version, for example `PR-15-ad2344f` or similar, but this way there might be lots of versions aggregated in the Pact broker over time. What would your suggestion be in this kind of a use case? Thanks for reading, and sorry for the wall of text, I know context is important :slightly_smiling_face: I still have some other questions, but this is the most pressing one I have so far. [1]: https://concourse-ci.org/implementing-resource-types.html

james.hattersley-dyke
2019-10-21 15:52
Can anyone confirm if this is a known issue? I set up a webhook thusly: ``` { "request": { "headers": { "accept-encoding": "gzip;q=1.0,deflate;q=0.6,identity;q=0.3", "accept": "*/*", "user-agent": "Ruby", "content-type": "application/json", "authorization": "**********", "host": "http://jenkins.management.cldinf.net", "content-length": "31" }, "body": { "SERVICE_NAME": "user-insight" }, "url": "https://jenkins/job/webapp/job/pact-verify-provider-gradle/job/master/buildWithParameters" }, ``` This successfully trigger the build and the build is set up to take the service name parameter. It's a dynamic replacement on `${pactbroker.providerName}` which is getting replaced however, it's not getting populated in the post body of the request to Jenkins... the same request works in Postman and when I use a POST request with a querystring (my work around)

james.hattersley-dyke
2019-10-21 15:54
ah wait... it's getting passed as JSON

james.hattersley-dyke
2019-10-21 15:55
`INFO: content-length: 31\n[2019-10-21T15:37:46Z] INFO: {\"SERVICE_NAME\":\"user-insight\"}\n`

james.hattersley-dyke
2019-10-21 15:55
which Jenkins will ignore.

james.hattersley-dyke
2019-10-21 15:55
user error, I created it as JSON :slightly_smiling_face:

james.hattersley-dyke
2019-10-21 15:56
RTFM James :slightly_smiling_face:

bethskurrie
2019-10-22 01:06
I've just put out a new release of the Pact Broker and the docker images with a MASSIVELY OPTIMIZED matrix query for the can-i-deploy tool (like, we're talking 50 seconds down to 0.7 seconds). Lesson learnt - start with the rows you're interested and build up the dataset from that base, rather than building up the entire dataset and then finding the rows you're interested in.

bethskurrie
2019-10-22 01:16
/github subscribe list

bethskurrie
2019-10-22 02:43
Ok, it sounds like you need some features that are coming out as soon as I have time to finish them.


bethskurrie
2019-10-22 02:46
For some reason I've half written 2 posts on this http://blog.pact.io/p/51906e22-ccce-486b-9993-c21794e557d4/

bethskurrie
2019-10-22 02:47
The other option is to query the matrix resource to find out what you want.

bethskurrie
2019-10-22 02:50
you can use the can-i-deploy CLI with the JSON output to find out which pacts are missing verification results


bethskurrie
2019-10-22 02:54
``` export PACT_BROKER_BASE_URL="https://test.pact.dius.com.au" export PACT_BROKER_USERNAME="dXfltyFMgNOFZAxr8io9wJ37iUpY42M" export PACT_BROKER_PASSWORD="O5AIZWxelWbLvqMd8PkAVycBJh2Psyg1" docker run --rm \ -e PACT_BROKER_BASE_URL \ -e PACT_BROKER_USERNAME \ -e PACT_BROKER_PASSWORD \ pactfoundation/pact-cli:latest \ broker can-i-deploy \ --pacticipant Foo \ --latest master \ --pacticipant Bar \ --latest master \ --output json ```

bethskurrie
2019-10-22 02:54
Run the above if you've got docker.

bethskurrie
2019-10-22 02:55
It asks "is there a valid verification result between latest latest master version of Foo and the latest master version of Bar"

ppaduch
2019-10-22 07:01
has joined #pact-broker

me_pact
2019-10-22 09:49
Thanks for the input Beth! For the time being, I believe I will switch to using the git hash from the latest commit on the GitHub PR as a consumer version, and use the HTTP version of `can-i-deploy`. If this works, I'll keep it and periodically do version clean up, as I can imagine that there will be quite a lot of versions created over the time.

bethskurrie
2019-10-22 09:50
Grab the very latest copy of the broker. It has some serious optimisation to help with the large amount of data.

bethskurrie
2019-10-22 09:51
Also, I'll be releasing some tasks to clean up old data soon.

me_pact
2019-10-22 09:58
Nice, this is awesome!

antonello
2019-10-23 08:23
Hi @bethskurrie? I may have lost track of its progress. What?s the status of the pending pacts feature? Is there now any official documentation beyond the original blog post?

bethskurrie
2019-10-23 09:57
Depends which language.

bethskurrie
2019-10-23 09:58
I've got it released in the Ruby, but feature toggled off until Ron has made sure he can implement it in Java the way I've designed it.

bethskurrie
2019-10-23 09:59
If you're using one of the languages that wraps the Ruby standalone, you can try it, but it may change.

antonello
2019-10-23 10:16
All the provider verifications are in Java

antonello
2019-10-23 10:17
consumers are a mix - some Java, some JS, some iOS (which would be the only one that wraps ruby standalone)

antonello
2019-10-23 10:17
I saw you renamed pending pacts to pacts for verification in the latest release

stevi.deter
2019-10-23 16:30
has joined #pact-broker

stevi.deter
2019-10-23 16:37
Hi, all. I just did a demo of Pact to my org yesterday and there's a lot of interest. We're leaning towards hosting our own, which leads to questions about the ops side of it. Specifically, are there any recommendations/details on best practices for ops for the database (we'll use Postgres). Expected size and rate of grown, memory needs, compaction, log rotation needs.

matt.fellows
2019-10-23 21:33
Hi Stevi!

matt.fellows
2019-10-23 21:33
Not really, the pact broker github has the minimum requirements but as you say, you?ll need to figure all of those things out (Postgres is the right choice, btw!)

matt.fellows
2019-10-23 21:34
All of those factors really depend on how many projects and builds you have, and how important history is etc. etc.

bethskurrie
2019-10-23 21:37
Yes, theres's now a single endpoint to retrieve the list of pacts to verify in one go, rather than making a separate call for each tag.

bethskurrie
2019-10-23 21:39
You tell the endpoint what consumer version tags you want to verify and what provider version tag you're going to tag the results with, and it works out which pacts are "pending" for that provider tag (ie. which should run without breaking the provider build because they've never been successfully verified before).

bethskurrie
2019-10-23 21:44
I haven't yet added in the "WIP" pacts in to that response yet, but it won't be much work. (The "wip pacts" is the feature that automatically brings in the recently changed pacts to verify in pending mode so that the provider team doesn't have to change the list of tags they verify).

bethskurrie
2019-10-25 23:46
New release of the pact broker + docker containers with a fix for a bug that was introduced with the latest matrix optimisations. 2.40.0-1.

antonello
2019-10-26 13:22
What?s the bug?

archana.rachuri
2019-10-27 21:47
has joined #pact-broker

srinivasan.anusha
2019-10-28 22:50
has joined #pact-broker

adrian.mace
2019-10-30 01:11
has joined #pact-broker

adrian.mace
2019-10-30 01:13
Hi all, do you foresee any issues upgrading pact-broker from `2.35.0-1` straight to `2.40.0-1` deployed using the `dius/pact-broker` docker image?

bethskurrie
2019-10-30 01:25
No

bethskurrie
2019-10-30 01:25
No backwards incompatible changes.

lwillmeth
2019-10-30 18:56
has joined #pact-broker

lwillmeth
2019-10-30 18:57
Can the Pactflow broker begin Provider verification if someone queries can-i-deploy for an unresolved version? Or is it left to the human to check and start that process?

lwillmeth
2019-10-31 21:19
The best practices page talks about this a bit, suggesting using CI and webhooks to validate changing contracts: https://docs.pact.io/best_practices/pact_nirvana#d-configure-pact-to-be-verified-when-contract-changes The can-i-deploy wiki talks about true/false results. It sounds like it may not distinguish between a false result and no result?


bethskurrie
2019-11-01 03:40
@lwillmeth if you use --output json you can get the underlying JSON response. In it you can tell if there is no result (because the verificationResult is null) or a failed result (because verificationResult is present and has a success of false).

bethskurrie
2019-11-01 03:41
The more recent versions of the Pact Broker should give you some very clear text describing whether the result is missing or failed also.

bethskurrie
2019-11-01 03:42
> Can the Pactflow broker begin Provider verification if someone queries can-i-deploy for an unresolved version? Can you explain your usecase?

yosevuk
2019-11-01 16:07
Hello! I was just wondering, is there a way to few the Pact file for a contract in a pact broker URL?

matt.fellows
2019-11-01 21:25
Wish do you mean, sorry?

lwillmeth
2019-11-04 17:06
My understanding is that webhooks should trigger provider build tests when a consumer contract changes. This resolves all consumer contracts against the current provider version. If we wanted to roll back the provider for whatever reason, we wouldn't know the outcome of the latest consumer vs an older provider, because the latest consumer didn't exist when the older provider built. It seems like can-i-deploy would catch this scenario, and to fix it, we'd re-run the (older) provider build. It sounds like this is an edge case that shouldn't be happening often, and a human could resolve if it does.

bethskurrie
2019-11-04 19:48
Yes, that sounds right @lwillmeth. If you roll back, remember to remove the prod tag from the previously deployed version so that the "latest" prod version is accurate again.

yosevuk
2019-11-05 13:07
oh typo! I meant is there a way to view the generated pact file itself, but I see you can get to a history of test results when you "View Matrix"

bernardoguerr
2019-11-05 20:23
has joined #pact-broker

crajcan
2019-11-06 22:27
has joined #pact-broker

kv
2019-11-07 16:25
has joined #pact-broker

ayip
2019-11-08 02:03
has joined #pact-broker

mahadi087
2019-11-08 08:05
has joined #pact-broker

thomas.scheuchzer2
2019-11-11 13:54
has joined #pact-broker

thomas.scheuchzer2
2019-11-11 13:55
is this already fully implemented? http://blog.pact.io/p/d7c9601f-e2ca-4208-b1c0-f02eaf96c3c2/ I can see some stuff in the source-code but I can't find it in the HAL-browser

brentbarker9
2019-11-11 18:57
Hi! Does the pact-broker support v3 pacts? I'm locked into using v2.24 because we use v3 pacts and the broker fails to load those with newer versions - granted I haven't tried upgrading since last year but instead I've been keeping an eye on https://github.com/pact-foundation/pact_broker/issues/241

psychopomp3x
2019-11-11 20:37
has joined #pact-broker

bethskurrie
2019-11-11 21:35
@thomas.scheuchzer2 it's out in limited beta if you're using pact-js or pact-go. Talk to @matt.fellows about it if you're interested.

matt.fellows
2019-11-11 21:36
:wave:

bethskurrie
2019-11-11 21:37
It's feature toggled off for now, as I don't want anyone relying on an API that will mostly likely have changes. We've already decided to make the GET into a POST as the query params are too complicated.

bethskurrie
2019-11-11 21:38
@brentbarker9 sorry, this fell off my radar.

bethskurrie
2019-11-11 21:40
Can you post the redacted content of one of the pacts that causes the problems? I haven't been able to replicate it.

rbhati
2019-11-11 21:49
has joined #pact-broker

brentbarker9
2019-11-11 22:18
No problem! You do a ton! I'll get a pact put together that exposes this problem.

bethskurrie
2019-11-11 22:18
thanks :slightly_smiling_face:

dimapasko
2019-11-12 16:43
has joined #pact-broker

rafael.anachoreta
2019-11-13 15:59
hello! perhaps a silly question, but is there any implementation of the broker client that supports the `can-i-deploy` command that I can run programmatically with groovy? Similar to what I can do atm with `pact-node` I want to add a try/catch in the code to either trigger a new run on my provider or not depending on whether the pact has been verified (either resulting in SUCCESS or FAILURE) or is UNKNOWN

rafael.anachoreta
2019-11-13 15:59
alternatively, is there a better way to do what I?m trying? :thinking_face:

ingo.griebsch
2019-11-13 17:04
has joined #pact-broker

abubics
2019-11-13 23:35
`shell` :troll:

abubics
2019-11-13 23:36
are you trying to run it from gradle, or some other groovy runtime?

matt.fellows
2019-11-14 01:00
As Andras said, I?d just do something like this: ``` if [ $(pact-broker ...) = 0 ]; then # exit 0 else # do other thing fi ```

bethskurrie
2019-11-14 06:07
@rafael.anachoreta The command line can-i-deploy tool uses a fairly complicated query to the /matrix endpoint. I've made a simpler endpoint specifically for the can-i-deploy usecase. The docs are in the HAL browser, but here is the source. https://github.com/pact-foundation/pact_broker/blob/master/lib/pact_broker/doc/views/can-i-deploy.markdown

bethskurrie
2019-11-14 06:07
You'll need v2.39.0+

bethskurrie
2019-11-14 06:09
It currently only works with the simplest usecase of one application, a known version number and an environment tag.

bethskurrie
2019-11-14 06:11
Btw, what is your usecase for this? Most people use webhooks to trigger provider builds.

bart.schotten
2019-11-14 08:14
Am I correct that the pact broker does not offer a way to search/filter pacts based on some text in the content?

rafael.anachoreta
2019-11-14 08:42
Let me try to describe my use case in details. We have all of our (internal) providers and consumers built and deployed within our internal Jenkins (i.e. not public). We also have our internal pact broker running in docker (`FROM dius/pact-broker:2.29.0-1`, but we could update it if necessary). For all of our consumers and providers, we have a Jenkinsfile built with a scripted pipeline that we?ve built in groovy and that describes what is supposed to happen when a job is run (build, test, deployment, etc). I?m currently adding Pact runs to this pipeline library that we have. My idea is to have all the consumers always publishing the pact when their build is run (no matter if feature branch) and then having the capability to request a re-run on their provider?s verification step if their published pact results in UNKNOWN. That?s when the can-i-deploy step would come into play. If unknown, then the consumer should be able to trigger a re-build on the provider?s job directly, except we don?t want that to re-trigger a deployment (for projects where we have CD), so I?m passing in a variable that will split our scripted pipeline - ?Should pact verification run?? PACT boolean. For that we need parameterized jobs, but that should also be fine since the default will remain as is. So far I have three new steps that should be generic enough for them to work on all of our projects, regardless if they are using Java, Kotlin, JS etc: `def publishPacts(String path, String tags = env.BRANCH_NAME, String consumerVersion = env.GIT_COMMIT, String mode = overwrite)` `def canIDeployPact(String consumer, String provider, String providerBranch = "master", String version = env.GIT_COMMIT, Predicate predicate = { env -> true })` `def publishPactVerificationResults(Closure step, Predicate predicate = { env -> env.PACT_VERIFICATION })` The predicate passed in allows me to decide whether or not the step should be run, so it gives projects more customization options. I?ve considered hooks but decided against it as they felt like a bit of overhead since in the end the goal would still be to re-trigger the job. By running them directly I also can wait until the run is finished instead of having to poll for an update on the version, for example (though there might be a hook to address this)

bethskurrie
2019-11-14 08:44
Yes, there is a hook for verification published.

bethskurrie
2019-11-14 08:45
It's not the standard workflow, but let me know how it goes for you.

bethskurrie
2019-11-14 08:46
There's actually a "poll while waiting" feature on can-i-deploy if you want it.

rafael.anachoreta
2019-11-14 08:47
will do! :slightly_smiling_face: what would you suggest instead? because what I was having trouble with the hooks is that I couldn?t really pass the consumer info to the provider without parameterizing my Jenkins provider anyway

bethskurrie
2019-11-14 08:48
I woulnd't pass the consumer info, I would pass the pact URL to verify - but yes, that's requires a parameterised build. It's assumed that the verification build for the "pact changed" workflow would be parameterised.

rafael.anachoreta
2019-11-14 08:48
I?ve gone through the Pact Nirvana (thanks for that btw :pray:) and I thought I was using the standard flow, but apparently not

rafael.anachoreta
2019-11-14 08:48
aha - that?s a very good point, I might be able to do that too

bethskurrie
2019-11-14 08:49
So, I need a diagram for this. I think someone did a good one, and I need to see if I can include it in the docs.


rafael.anachoreta
2019-11-14 08:51
hmmmm I see what you mean, that would make more sense, yes > Having this as a separate job rather than bundling it in with the test or deploy jobs means that the reason for a ?failure? is obvious at a glance.

akazantseva2
2019-11-14 13:25
has joined #pact-broker

shero86
2019-11-14 15:28
has joined #pact-broker

rafael.anachoreta
2019-11-14 15:34
quick update - it seems the `/can-i-deploy endpoint` is exactly what I need :slightly_smiling_face: I?ve bumped our image to latest but sadly I haven?t been able to successfully use that endpoint :confused: might be related to me not having versioned my provider properly will check the logs and continue tomorrow!

carolyn.biggar
2019-11-15 23:09
has joined #pact-broker

bethskurrie
2019-11-18 00:01
@bart.schotten not yet, but it's something that I've always intended to add. You're the first person to actually ask for it though.

bethskurrie
2019-11-18 00:02
Would you like to raise a feature request issue in https://github.com/pact-foundation/pact_broker ?

bethskurrie
2019-11-18 00:03
@rafael.anachoreta I have to admit, I just threw that endpoint out there to help someone out, and I haven't extensively tested it. What are you seeing?

bart.schotten
2019-11-18 07:05
Will do that :+1: It's funny how you only realize you need this when you have > 100 integrations.

bethskurrie
2019-11-18 07:34
I suspect not many places get to 100 integrations with pact tests!

rafael.anachoreta
2019-11-18 08:30
in a nutshell, it took me a while to realize I needed the tag of the *provider* there to be able to really use the endpoint. To be fair, the documentation you added does make that clear, it is just that I could never tell there were differences between provider and consumer tags I?ve commented on #pact-jvm how currently that?s not intuitive at all, but hey it works once you have everything in place. https://pact-foundation.slack.com/archives/C9UN99H24/p1573750562133500

bethskurrie
2019-11-18 08:32
That description does sound confusing.

bethskurrie
2019-11-19 03:01
@antonello sorry, I didn't see this. I can't remember now! But you'll want the next release I do because the pagination will stop your server falling over if someone views the "index with latest tags" page.

marco
2019-11-19 08:30
has joined #pact-broker

rbhati
2019-11-19 23:10
Hi #pact-broker , need some help please: Steps: 1. Build fresh instance of pact-broker using docker-compose 2. Run consumer side test, pact.json pushed to pact-broker - version *consumer-1.0* 3. Run provider side test via pactman-verifier, thus result Passed & pushed to pact-broker with version *provider-1.0* [Please continue to read] 4. Intentionally I made change in consumer side test that must fails the test; So I run and pushed pact.json with new version *consumer-1.1* to pact-broker 5. Run provider test, pushed result to pact-broker, Result turned Red 6. Revert changes in consumer test, run test, and push result to pact-broker with version *consumer-1.2* Now when I look into - Matrix, I see *consumer-1.2* is green with provider version *provider-1.0* :exploding_head: I have not run any provider test after I got *consumer-1.2*, and there is no webhook setup. Then how come the result appear *Green* Please help me understand this phenomenon of pact-broker

bethskurrie
2019-11-19 23:21
Magic! @rbhati!


bethskurrie
2019-11-19 23:22
Your two application versions use the same pact content, and hence the same underlying pact version in the database. The verification is attached to the pact version.

bethskurrie
2019-11-19 23:23
If you publish a pact with the same contents as a previous one, it inherits all the same verifications.

bethskurrie
2019-11-19 23:42
This means that you don't need to do a verification cycle if you're publishing a pact with the same content as previously. You get instant feedback, and can deploy straight away.

matt.fellows
2019-11-20 04:55
As @bethskurrie says - magic! That is the secret sauce of the broker, and why it?s so powerful!

bethskurrie
2019-11-20 05:16
@rbhati and others. There is some pop up text for pre-verified pacts on the matrix page, but it's not obvious that there is anything to see unless you happen to hover over the cell. I'm making it more obvious. Trying to find an appropriate bootstrap icon for the pre-verified pacts. Currently the best on I can find is a clock. Can anyone suggest anything more applicable? https://getbootstrap.com/docs/3.3/components/

bethskurrie
2019-11-20 05:22
Not sure what is the most obvious to someone unfamiliar with the concept.

bethskurrie
2019-11-20 05:23
`"This pact was "pre-verified" as it has identical content to a previously verified pact."`

bethskurrie
2019-11-20 05:23
`"This verification has been inherited from a previously verified pact with identical content."`

tanle.oz
2019-11-20 09:43
How about `glyphicon glyphicon-check` ?

bethskurrie
2019-11-20 09:47
Hm, it could be a failed verification.

bethskurrie
2019-11-20 09:48
So it might be confusing to have a tick for a failure.

tanle.oz
2019-11-20 11:00
oh yep that would not be appropriate then

kevin.meiresonne
2019-11-21 09:27
maybe glyphicon glyphicon-fast/step-forward

bethskurrie
2019-11-21 09:31
That's an idea

bethskurrie
2019-11-21 09:31
I'll see how it looks

bethskurrie
2019-11-21 09:31
Any opinion on the text options @kevin.meiresonne?

kevin.meiresonne
2019-11-21 09:33
Thinking...

kevin.meiresonne
2019-11-21 09:38
I think I prefer "This pact was pre-verified as it has identical content to ~a~ _the_ previously verified pact."

bethskurrie
2019-11-21 20:45
@kevin.meiresonne it is technically "a" because it doesn't have to be the most recent pact content for it to be pre-verified.

kevin.meiresonne
2019-11-22 07:55
ah, didn't know that

kevin.meiresonne
2019-11-22 07:55
I figured it was always based on the last version

bethskurrie
2019-11-22 08:04
To be very accurate, it's not even that there is a pre-verification action, it's just that the new pact publication object references the existing pact version object (which has the content), which already has the verification results attached to it.

pavel.azarau
2019-11-22 17:04
has joined #pact-broker

ambergkim
2019-11-26 06:22
has joined #pact-broker

megha.agrawal
2019-11-26 18:46
has joined #pact-broker

johnny.nilsson83
2019-11-27 08:01
has joined #pact-broker

me1352
2019-11-27 17:01
has joined #pact-broker

justaburneremailforso
2019-11-27 17:04
has joined #pact-broker

artemabezruchko
2019-11-28 17:00
has joined #pact-broker

kv
2019-12-02 14:52
Hey hello, I was wondering if anyone have some experience with setting up a GitLab pipeline with pact and pact broker? I have a postgres container running on an AWS EC2 instance, and need to link that to the pact container I spin up in the test phase of my pipeline, but I'm having some issues doing so... Please pm :slightly_smiling_face:

c.talek
2019-12-02 19:27
has joined #pact-broker

bethskurrie
2019-12-02 20:52
@kv i'm confused as to what your issue is. Are you talking about starting and stopping the Pact Broker during your test? Or are you talking about one of the pact-cli docker containers?

kv
2019-12-03 11:43
@bethskurrie Saw that my msg was a bit cryptic maybe, didn't take into consideration the time difference so thought I could explain more in detail when I got in contact with someone yesterday :slightly_smiling_face: I have followed the documentation to set up the pact broker locally. It works to run the docker commands provided, spin up a postgres container and I can get the verification to work between 2 services. :the_horns: The problem I'm facing now though is to publish the pact from the consumer tests pipeline on GitLab. I have an EC2 instance where I'm running the postgres container, and in my pipeline, I have a step that looks like this: ```contract-test:consumer: services: - name: pactfoundation/pact-broker:latest command: ["--link", "my-pact-postgres:postgres", "-p", "9292:9292"] alias: pact-broker stage: contract-test-consumer image: my-registry/pact-node-ruby script: - yarn add jest - yarn contract:test - yarn contract:publish except: variables: - $DISABLE_CONTRACT_TESTING_CONSUMER``` `publish.js`: ```let publisher = require("@pact-foundation/pact-node") let path = require("path") let opts = { pactFilesOrDirs: [path.resolve(process.cwd(), "pacts")], pactBroker: "http://pact-broker:9292", consumerVersion: "2.0.0" } publisher.publishPacts(opts).then(() => done())``` It could be that the error is due to the gitlab part, but since I haven't used gitlab nor pact extensively, I'm not sure. The error I get in the pipeline is this: ```$ yarn contract:publish yarn run v1.19.1 $ node ./publish.js [2019-12-03T11:18:55.511Z] INFO: pact-node@10.0.1/130 on runner-Kd24fm4z-project-8-concurrent-0: Publishing Pacts to Broker [2019-12-03T11:18:55.513Z] INFO: pact-node@10.0.1/130 on runner-Kd24fm4z-project-8-concurrent-0: Publishing pacts to broker at: http://pact-broker:9292 [2019-12-03T11:19:06.422Z] WARN: pact-node@10.0.1/130 on runner-Kd24fm4z-project-8-concurrent-0: Pact exited with code 1. [2019-12-03T11:19:06.423Z] ERROR: pact-node@10.0.1/130 on runner-Kd24fm4z-project-8-concurrent-0: Could not publish pact: /builds/services/api-gateway/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.70.2/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/shared_helpers.rb:78: warning: Insecure world writable dir /builds/services/api-gateway in PATH, mode 040777 Error making request - Errno::EBUSY Device or resource busy - getaddrinfo /builds/services/api-gateway/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.70.2/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.20.0/lib/pact_broker/client/pacts.rb:35:in `get', attempt 1 of 3 Error making request - Errno::EBUSY Device or resource busy - getaddrinfo /builds/services/api-gateway/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.70.2/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.20.0/lib/pact_broker/client/pacts.rb:35:in `get', attempt 2 of 3 Error making request - Errno::EBUSY Device or resource busy - getaddrinfo /builds/services/api-gateway/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.70.2/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.20.0/lib/pact_broker/client/pacts.rb:35:in `get', attempt 3 of 3 Failed to publish API Gateway/Role Service pact due to error: Errno::EBUSY - Device or resource busy - getaddrinfo One or more pacts failed to be published``` Maybe this is not related to pact, sorry if so. But maybe someone ran in to a similar issue before.. :face_with_rolling_eyes:

idamasce
2019-12-04 13:48
has joined #pact-broker

idamasce
2019-12-04 13:50
Hello everyone, has anyone gone through problems with bundler while trying to use the pack broker on openshift container platform?

andrew.williams439
2019-12-04 15:15
has joined #pact-broker

paul.simms
2019-12-04 16:12
has joined #pact-broker

bethskurrie
2019-12-04 20:12
@idamasce can you make a gist that demonstrates the issue you're having?


idamasce
2019-12-05 13:38
Hey @bethskurrie! Yes I was following this example. For some reason the bundler was not being recognised inside the pod on Openshift. However I have found out another openshift template that solved my problem. Thanks for your response anyways!

igalbenardete
2019-12-06 09:44
has joined #pact-broker

samuel.hodgkinson
2019-12-06 14:19
Has anyone tried adding token auth in front of the open source broker?

justaburneremailforso
2019-12-06 16:22
I am trying to run and publish the provider side results on our broker which has authentication turned on. I am passing in credentials using the example in the link below but it is not working. These variables are replaced at runtime in our CI tool. The error I get is au.com.dius.pact.pactbroker.RequestFailedException: Request to path '/' failed with the response 'HTTP/1.1 400 Bad Request'. I am using mvn clean test to run the provider side tests and have pact.verifier.publishresults value set to true in the maven surefire plugin in my pom. The broker is not getting updated with any results, the LastVerified section is blank, it doesn't even show up as failed. I'm assuming the http error above is the issue but I don't know why it's happening. Anyone else seen this? https://github.com/DiUS/pact-jvm/tree/master/provider/pact-jvm-provider-junit#using-authentication-with-the-with-the-pact-broker

bethskurrie
2019-12-09 00:14
Hi @justaburneremailforso can you provide a gist with the code you're using?

bethskurrie
2019-12-09 00:15
Better yet, running code to demon the issue. 400 is interesting. It means something is wrong with the request, not necessarily auth

bethskurrie
2019-12-09 00:15
there should be a way to turn on debug logging. can you try that please?

bethskurrie
2019-12-09 00:15
Have you set the provider version number?

bethskurrie
2019-12-09 00:16
@idamasce if there are changes that need to be made to that template, future openshift users would appreciate a PR I'm sure!

justaburneremailforso
2019-12-09 09:38
Hello, unfortunately for disclosure reasons I can't post any code. We haven't had this issue when running with a broker that has auth switched off however we want to use authentication which is why it's on. When you say set the prover version number, where is that set? In our junit class we have the @PactBroker annotation and specify the host, port etc as well as adding the relevant section to our pom file. Our junit class also uses the @Provider annotation where we add in the correct provider name.

bethskurrie
2019-12-09 09:39
I'm afraid I'm not experienced with the JVM implementation

bethskurrie
2019-12-09 09:40
It will be in the docs.

bethskurrie
2019-12-09 09:40
Your best bet is to turn debug logging on.

bethskurrie
2019-12-09 09:41
Auth failures would be 401 or 403.


bethskurrie
2019-12-09 09:44
Sorry, I can't remove the preview from my phone client. It's very annoying.

bethskurrie
2019-12-09 09:44
"You need to set the version of the provider that is verified using the pact.provider.version system property."

bethskurrie
2019-12-09 09:45
Not that I've seen, but it should be very simple.


bethskurrie
2019-12-09 09:48
Sorry, I can't remove the annoying preview from my slack mobile client

ivangsa
2019-12-09 14:55
has joined #pact-broker

justaburneremailforso
2019-12-09 16:26
Yeah it's a strange error. I pointed the same code to a different broker that doesn't have auth switched on and mvn clean test and it runs and updates the broker last verified status. Three only change on my side is the broker details. Perhaps it's some sort of config difference.

gordo
2019-12-09 22:28
has joined #pact-broker

justaburneremailforso
2019-12-10 09:05
Typo *The only change

bethskurrie
2019-12-10 09:06
Very confusing. Did you find the debug setting?

bethskurrie
2019-12-10 09:06
I'm pretty sure there's a way to print out the request and response. Why the response body isn't printed out is strange.

bethskurrie
2019-12-10 09:06
Could you raise that as an issue in pact-jvm please?

bethskurrie
2019-12-10 09:07
I'm sure Ron would appreciate a PR if you have a few minutes to find the point of the error.

justaburneremailforso
2019-12-10 09:08
I will check it today to see if I can debug and get more info. I will also check with our team who looks after the broker to see if there is some config difference between the two (other than auth).

justaburneremailforso
2019-12-10 09:09
Yep, will raise an issue in pact-jvm

bethskurrie
2019-12-10 09:09
Are they different versions?

bethskurrie
2019-12-10 09:10
Can you make sure you're using the latest Pact JVM version, and the latest broker if possible?

bethskurrie
2019-12-10 09:10
We know they work together.

justaburneremailforso
2019-12-10 09:10
I'm not sure about the versions but will check.

bethskurrie
2019-12-10 09:11
There may be a bug if you're using an older version of pact JVM.

bethskurrie
2019-12-10 09:11
You can get the pact broker version from the response headers in the Hal browser.

justaburneremailforso
2019-12-10 09:13
It's version 2.40.0 of the broker.

bethskurrie
2019-12-10 09:13
Pretty recent.

bethskurrie
2019-12-10 09:14
And Pact JVM?

bethskurrie
2019-12-10 09:15
4.0.3 is the latest.

justaburneremailforso
2019-12-10 09:16
I have a few pact dependencies in my pom for the provider side but not sure if I need them all.

bethskurrie
2019-12-10 09:16
I'm afraid the current version is about as much as I know!

bethskurrie
2019-12-10 09:17
Maybe ask a question in the main pact-jvm channel

justaburneremailforso
2019-12-10 09:18
I have pact-jvm-provider-spring_2.12 version 3.6.7 Pact-jvm-model 3.6.7 Pact-jvm-provider-junit_2.11 version 3.5.0

justaburneremailforso
2019-12-10 09:18
Not sure I need all 3

bethskurrie
2019-12-10 09:18
:man-shrugging:

justaburneremailforso
2019-12-10 09:18
No worries, thanks

justaburneremailforso
2019-12-10 11:56
Just an FYI, got this working. Posted the following in the pact-jvm as a response. "Got this resolved. We needed to set the scheme as Https and the full hostname in the @PactBroker annotation section of the junit class. Previously we were using a shortened hostname and not setting the scheme as anything. We are still using the @PactBrokerAuth authentication piece."

sam774
2019-12-13 20:28
has joined #pact-broker

bethskurrie
2019-12-16 02:55
sorry for the channel at-ing, but I'd like to grab the attention of anyone who has talked to me about automating webhook creation in a build pipeline. @james.hattersley-dyke I think you were one of them. Can you add your usecases here? https://github.com/pact-foundation/pact_broker-client/issues/54

bheemreddy181
2019-12-16 03:18
This is great start @bethskurrie@bethskurrie@bethskurrie I will put in some use cases

mui_ume
2019-12-16 08:40
Can I use the docker pact-broker ?

bethskurrie
2019-12-16 08:48
That question doesn't really make sense @mui_ume. But I'm going to say, "yes"!

mui_ume
2019-12-16 08:51
The next question is how do I publish the pact file to the docker container ?

mui_ume
2019-12-16 08:52
If not how can I setup my pact broker easily ? I need to publish my pact file


bethskurrie
2019-12-16 08:55
If you're not sure how to use docker, you can sign up for a free hosted Pact Broker at http://pactflow.io

bethskurrie
2019-12-16 08:56
You'll need to look at the documentation for the language you're using. There will be a section on publishing and verifying pacts from a broker.

mui_ume
2019-12-16 09:18
I have signed up at pactflow How can I setup ? My consumer is using Javascript

mui_ume
2019-12-16 09:21
Maybe I check it out at pact-js channel

bethskurrie
2019-12-16 09:21
Look at the docs

bethskurrie
2019-12-16 09:21
The instructions are in the pact-js readme

mui_ume
2019-12-16 09:23
I don?t find it What is the line to add at the package.json

mui_ume
2019-12-16 09:24
I should be something like this "publish:pact": "pact-broker publish ./pacts -a 2.0.0 -b https://taiger.pact.dius.com.au/",


mui_ume
2019-12-16 09:25
I got authentication failed

bethskurrie
2019-12-16 09:26
You need to configure your bearer token.



matt.fellows
2019-12-16 09:27
Lol

matt.fellows
2019-12-16 09:27
What Beth said

mui_ume
2019-12-16 09:28
Do you have an example to show What the package.json look like and the pactSetup.js ?

matt.fellows
2019-12-16 09:29
For .. what exactly?

bethskurrie
2019-12-16 09:29
Yes - in the page we just sent. Look at the "Node Publishing" section.

mui_ume
2019-12-16 09:45
I still didn?t get it work

bethskurrie
2019-12-16 09:47
You'll need to be more specific.

mui_ume
2019-12-16 09:47
What is the command to publish to the pact broker ?

bethskurrie
2019-12-16 09:49
Whatever you set it to be!

mui_ume
2019-12-16 09:50
something like this ? "publish:pact": "pact-broker publish ./pacts -a 2.0.0 -b https://taiger.pact.dius.com.au/",


bethskurrie
2019-12-16 09:51
The line you pasted needs a bearer token

bethskurrie
2019-12-16 09:51
--broker-token TOKEN

mui_ume
2019-12-16 09:54
Okay let me try

mui_ume
2019-12-16 09:56
Still didn?t work Here is the content of my pactSetup.js ```// ./pact/setup.js // To configure the Pact mock provider const path = require('path'); const { Pact } = require('@pact-foundation/pact'); global.port = 8081 global.host = '127.0.0.1'; global.Platform = new Pact({ cors: true, port: global.port, log: path.resolve(process.cwd(), 'logs', 'pact.log'), loglevel: 'debug', dir: path.resolve(process.cwd(), 'pacts'), spec: 2, pactfileWriteMode: 'update', consumer: 'iconverse frontend', provider: 'iconverse backend', host: global.host, pactBroker: 'https://myco.pact.dius.com.au/', pactBrokerToken: 'xxxx' });```

bethskurrie
2019-12-16 09:59
Please don't paste your private token on the internet!

bethskurrie
2019-12-16 09:59
That doesn't look like your broker's URL.

mui_ume
2019-12-16 10:00
I replaced the company name with myco

mui_ume
2019-12-16 10:01
I am trying to find the command option for pact-broker

bethskurrie
2019-12-16 10:01
I don't think you can put the broker options into the mock service configuration

bethskurrie
2019-12-16 10:02
Here's another example


bethskurrie
2019-12-16 10:02
Can I ask, are you a developer or tester?


bethskurrie
2019-12-16 10:03
Can I suggest getting a developer at your company to help you with this?

mui_ume
2019-12-16 10:03
I?m trying to setup a poc to show the developer

bethskurrie
2019-12-16 10:03
It's very hard to help someone who is not a developer learn how to code via chat.

mui_ume
2019-12-16 10:03
The pact consumer is done Now it?s to Setup the pact broker

bethskurrie
2019-12-16 10:04
There are multiple examples on the internet. I've sent you two.

bethskurrie
2019-12-16 10:04
If you can't follow them, I don't think I can help you any more than that.

bethskurrie
2019-12-16 10:04
You need a developer who knows node to sit with you.

bethskurrie
2019-12-16 10:08
You could try using the CLI directly


mui_ume
2019-12-16 10:16
I will try to figure out later The example show pactbrokerUsername This is the login name to http://pactflow.io ?

bethskurrie
2019-12-16 10:27
No, you need to use the token configuration

bethskurrie
2019-12-16 10:29
Your username and password for the UI have been sent to you in an email

bethskurrie
2019-12-16 10:29
To use the API you need your token.

dannybrown2710
2019-12-16 10:42
@channel can we use the pact mock server initiated in consumer for actually mocking API for UI functionality? Can we actually hit the server and get the response which already has interactions added to it? Or is it just for testing interactions against test cases?

matt.fellows
2019-12-16 10:43
do you mean something like this: https://docs.pact.io/getting_started/stubs ?

matt.fellows
2019-12-16 10:51

matt.fellows
2019-12-16 10:53
you need to specify the `pactBrokerToken` property, which you can get from the API tokens screen (note it must be a read/write token)

mui_ume
2019-12-16 11:22
I got it work thanks I need to get fr the read/write API token

mui_ume
2019-12-16 11:22
Thanks Matt and Beth I got it

rbhati
2019-12-16 22:41
hi there: qq: every time i run `$ pact-broker can-i-deploy --participant "consumer_app" --version "ba433a1" --participant "provider_abc" --version "1.2" --broker-base-url https://pact-broker.myoffice.com/` I get `No value provided for required options '--pacticipant'` Not sure, the cause of error; did tried `--broker-base-url https://username:/` but still no luck

bethskurrie
2019-12-16 22:42
It's paCticipant, not paRticipant

bethskurrie
2019-12-16 22:42
I'm so sorry.

bethskurrie
2019-12-16 22:43
When I wrote this software 6 years ago, I had no idea it would be this widely used, and it was just a little pun "a participant in a pact" => "pacticipant".


bethskurrie
2019-12-16 22:43
I have regretted it deeply since then!

bethskurrie
2019-12-16 22:43
If/when I make version 2 of the API, it will just be called "application". That's why the short option is `-a`.

rbhati
2019-12-16 22:44
wonder any thoughts why not `consumer / provider`??

bethskurrie
2019-12-16 22:44
because an application can be both.

bethskurrie
2019-12-16 22:45
if an application is both consumer and provider, you're not deploying it just in its consumer role, you're also deploying it in its provider role.

rbhati
2019-12-16 22:55
`can-i-deploy` is awesome thanks @bethskurrie

bethskurrie
2019-12-16 22:55
Glad you like it!

dannybrown2710
2019-12-17 07:26
Alright, so the mock server that starts to run these tests cannot be used, but another stub server can be used. I was enquiring about that, but never mind , it anyhow solves the purpose

gaurav.singh55
2019-12-20 03:30
has joined #pact-broker

mui_ume
2019-12-20 10:08
Can I set up my pact broker in the local host ?

matt.fellows
2019-12-20 11:04
Can you run it locally you mean?

matt.fellows
2019-12-20 11:05
Yes you can, but you'd only do that for local testing

mui_ume
2019-12-20 11:14
Okay so I can point the pact broker URL to http://localhost:3000?

mui_ume
2019-12-20 11:15
Any setup I need to start the pact broker running at this URL ?

bethskurrie
2019-12-20 19:13
Running it locally requires a fair bit of expertise. You'd at least need to know how to use docker.

bethskurrie
2019-12-20 19:13
I'd recommend you stick with the hosted one, given you're not an experienced developer.

mui_ume
2019-12-21 00:25
Thanks Beth I know docker I will find time to explore to gain the experience

taisedias
2019-12-22 21:53
has joined #pact-broker

mui_ume
2019-12-23 06:22
Could someone explain why I?m getting this ? Could not publish pact: Failed to publish Consumer/Provider pact due to error: PactBroker::Client::Error - This is the first time a pact has been published for "Consumer". The name "Consumer" is very similar to the following existing consumers/providers: * consumer If you meant to specify one of the above names, please correct the pact configuration, and re-publish the pact. If the pact is intended to be for a new consumer or provider, please manually create "Consumer" using the following command, and then re-publish the pact: $ curl -v -XPOST -H "Content-Type: application/json" -d "{\"name\": \"Consumer\"}" https://taiger.pact.dius.com.au/pacticipants If the pact broker requires basic authentication, add '-u <username:password>' to the command. To disable this check, set `check_for_potential_duplicate_pacticipant_names` to false in the configuration. This is the first time a pact has been published for "Provider". The name "Provider" is very similar to the following existing consumers/providers: * provider If you meant to specify one of the above names, please correct the pact configuration, and re-publish the pact. If the pact is intended to be for a new consumer or provider, please manually create "Provider" using the following command, and then re-publish the pact: $ curl -v -XPOST -H "Content-Type: application/json" -d "{\"name\": \"Provider\"}" https://taiger.pact.dius.com.au/pacticipants If the pact broker requires basic authentication, add '-u <username:password>' to the command. To disable this check, set `check_for_potential_duplicate_pacticipant_names` to false in the configuration. One or more pacts failed to be published

mui_ume
2019-12-23 06:39
Here is my publish.js- let publisher = require("@pact-foundation/pact-node") let path = require("path") let opts = { providerBaseUrl: "http://localhost:8082", pactFilesOrDirs: [path.resolve(process.cwd(), "pacts")], pactBroker: "https://taiger.pact.dius.com.au/", pactBrokerToken: process.env.PACT_TOKEN, consumerVersion: "2.0.0", } publisher.publishPacts(opts)

mui_ume
2019-12-23 06:42
Could not publish pact: Failed to publish Consumer/Provider pact due to error: PactBroker::Client::Error - This is the first time a pact has been published for "Consumer". The name "Consumer" is very similar to the following existing consumers/providers: * consumer

matt.fellows
2019-12-23 07:06
The error message is pretty clear.

matt.fellows
2019-12-23 07:07
You're publishing another very similar consumer and by default the pact broker will reject it to prevent confusion

matt.fellows
2019-12-23 07:07
Did you mean to publish another with the same name in lowercase?

matt.fellows
2019-12-23 07:07
The setting can be configured, if it's a problem

mui_ume
2019-12-23 07:24
Yes I need to configure it How can I do that ?

mui_ume
2019-12-23 07:31
Anyway I change the name to iConsumer to make it different

bethskurrie
2019-12-23 07:35
There should be a second line to that message that says how to force create the consumer with the name you want. Is it there?

mui_ume
2019-12-23 07:40
The name "Consumer" is very similar to the following existing consumers/providers: * consumer If you meant to specify one of the above names, please correct the pact configuration, and re-publish the pact. If the pact is intended to be for a new consumer or provider, please manually create "Consumer" using the following command, and then re-publish the pact: $ curl -v -XPOST -H "Content-Type: application/json" -d "{\"name\": \"Consumer\"}" https://taiger.pact.dius.com.au/pacticipants If the pact broker requires basic authentication, add '-u <username:password>' to the command. To disable this check, set `check_for_potential_duplicate_pacticipant_names` to false in the configuration.

mui_ume
2019-12-23 07:42
I set this line at publishPact.js - check_for_potential_duplicate_pacticipant_names: "false",

mui_ume
2019-12-23 07:42
It works now

bethskurrie
2019-12-23 07:43
`check_for_potential_duplicate_pacticipant_names` is a setting in the Pact Broker - it's not something you set in the client javascript.

marco
2019-12-24 10:34
Does someone have a Dockerfile for the Pact broker based on Debian Stretch?

bethskurrie
2019-12-24 10:35
Not that I've seen.

marco
2019-12-24 10:38
Thanks for your quick reply!

bethskurrie
2019-12-24 10:42
Just happened to be here! It doesn't mean someone else hasn't made their own, but there's no officially supported version.

bethskurrie
2019-12-24 10:42
What is it about that particular distribution that you're interested in?

marco
2019-12-24 10:44
This distro is unfortunately a constraint for the project I'm working on :disappointed:

bethskurrie
2019-12-24 10:45
It shouldn't be too tricky to roll your own based on the pactfoundation/pact-broker one

bethskurrie
2019-12-24 10:46
If you get it working, I don't mind adding it to the officially supported versions.

bethskurrie
2019-12-24 10:46
Or you could use http://pactflow.io

marco
2019-12-24 10:52
I'll try rolling my own! :slightly_smiling_face: I really would like to use Pactflow but that has to be OKed which is going to take some time..

bethskurrie
2019-12-24 19:32
So, you're going to need Ruby, obviously, but also the postgres client lib.

agarwalatrisha1212
2019-12-26 18:27
Hi All, i have sign up for pact and i havent received the password to login and access the broker, I will appreciate the help

agarwalatrisha1212
2019-12-26 18:29
usually people receive two email as my friend @mui_ume shared while sharing her experience setting up pact for the project but i dont receive two email with pacts

agarwalatrisha1212
2019-12-26 18:31
this is the only email with broker link i have received

bethskurrie
2019-12-26 22:11
@agarwalatrisha1212 firstly, best to ask in the #pactflow channel

bethskurrie
2019-12-26 22:12
Secondly, I assume you've checked your spam folder?

bethskurrie
2019-12-26 22:12
If you can't find it, we can do a manual reset for you. Please send an email to

agarwalatrisha1212
2019-12-26 22:17
Thank you for pointing it out right channel

agarwalatrisha1212
2019-12-26 22:18
There is no email on spam folder

bethskurrie
2019-12-26 22:18
I wonder if it's been blocked by your corporate email system.

agarwalatrisha1212
2019-12-26 22:18
Thank you , I will send to them

bethskurrie
2019-12-26 22:19
It comes from AWS Cognito, so it has a different sender.

agarwalatrisha1212
2019-12-26 22:20
no. I am using a personal email account

bethskurrie
2019-12-26 22:20
:thinking_face:

bethskurrie
2019-12-26 22:20
Very strange.

bethskurrie
2019-12-26 22:20
We've had a few people recently not receive the email. We might have to take it up with AWS.

bethskurrie
2019-12-26 22:22
Got your email, I'll get on to it as soon as I can.

agarwalatrisha1212
2019-12-26 22:22
Thank you , I assumed it because of holidays and not much people are actively working and that why i have pinged here too.

agarwalatrisha1212
2019-12-26 22:22
Thank you.

agarwalatrisha1212
2019-12-26 22:22
I appreciate your support :pray:

bethskurrie
2019-12-26 22:40
I will PM you @agarwalatrisha1212

agarwalatrisha1212
2019-12-26 22:45
Thank you for the prompt help . I really appreciate it :pray:

shilpa3006
2019-12-27 02:05
has joined #pact-broker

mui_ume
2019-12-28 03:39
May I know where I can set check_for_potential_duplicate_pacticipants_names? Thank

bethskurrie
2019-12-28 05:20
For pactflow? You can't.

bethskurrie
2019-12-28 05:20
what mismatch are you getting?

mui_ume
2019-12-28 05:20
I see no wonder I can?t any setting there

bethskurrie
2019-12-28 05:20
You need the names to be exact matches for the consumer and provider.


mui_ume
2019-12-28 05:21
If I need to run CI server This pact broker hosted on pactflow is good ? Can I have the option to use pact broker docker for Ci server ?

bethskurrie
2019-12-28 05:21
What names are being flagged as duplicates?

mui_ume
2019-12-28 05:22
Anyway I fixed it by using a different name iProvider instead of Provider

bethskurrie
2019-12-28 05:23
You can use the hosted service (pactflow) or run your own, but I'd recommend that you get your ops department to help you run it if you choose to run your own. It's something that requires experience to operate.

mui_ume
2019-12-28 05:23
This is minor I don?t need to have the name as Provider and Consumer

bethskurrie
2019-12-28 05:23
You trying to publish "consumer" and "Consumer" from memory.

mui_ume
2019-12-28 05:23
Thanks this can be done later But now I?m trying to work on the provider side

bethskurrie
2019-12-28 05:23
You need to choose one of them and stick to it.

bethskurrie
2019-12-28 05:23
The warning is not something you want to turn off - it's to stop you getting bad data in your broker.

mui_ume
2019-12-28 05:24
Okay I got it

bethskurrie
2019-12-28 05:24
If you have Consumer and consumer they are NOT the same thing, and you will have a lot of confusion.

mui_ume
2019-12-28 06:55
When I run my pact provider in js I noticed the result at the pact broker hosted on pactflow Keep flickering There are some error in the terminal from where I run the provider command


mui_ume
2019-12-28 08:20
Ok I will try to be more precise

mui_ume
2019-12-28 08:32
This occurred when i was trying to run the provider to verify the pact file It?s written in JS I will post to pact-js channel

bethskurrie
2020-01-06 00:29
Hey peeps. There was a vulnerability found in Rack (https://github.com/advisories/GHSA-hrqr-hxpp-chr3) It does not affect the Pact Broker as it doesn't use sessions, but if your vulnerability scanner is going off, you can upgrade to the latest gem/docker image and it will have the fixed Rack gem in it.

pavel.azarau
2020-01-06 21:44
Hey guys. Does anybody know if the list of Pactflow IP addresses provided here https://pactflow.io/faq/ is up to date?

matt.fellows
2020-01-06 21:52
It should be. Are you having issues?

matt.fellows
2020-01-06 21:52
P.s. you probably want the #pactflow channel

pavel.azarau
2020-01-06 21:53
thanks!

matt.fellows
2020-01-06 21:53
:+1:

bethskurrie
2020-01-09 22:57
Hey guys. If you're using tags when you specify which pacts you want to verify, do you ever have some consumers which use tags, and others which just use the latest pact?

justaburneremailforso
2020-01-13 21:16
Once you have added a tag to a pact using the create version tag tool, is there a way to change or remove the tag without deleting the entire consumer and provider from the broker?

bethskurrie
2020-01-13 21:16
@justaburneremailforso yes, just delete the tag resource

matt.fellows
2020-01-13 21:16
I believe you can just `DELETE` the tagged resource

matt.fellows
2020-01-13 21:16
lol

bethskurrie
2020-01-13 21:16
There's no cli for it, but just send a DELETE to `/pacticipants/PACTICIPANT/versions/VERSION/tags/TAG`

justaburneremailforso
2020-01-13 21:17
Ah ok, thanks. Is that some sort of curl request?

matt.fellows
2020-01-13 21:17
you could use cURL, or anything capable of making an HTTP request

justaburneremailforso
2020-01-13 21:18
Ok

bethskurrie
2020-01-13 21:18
You can do it through the HAL browser of your Pact broker

bethskurrie
2020-01-13 21:18
Go to the index page, click on "API Browser"

matt.fellows
2020-01-13 21:18
If you want to automate it in a CI pipeline though you?ll need to find a way without mouse clicks of course

bethskurrie
2020-01-13 21:18
in the location text box, put in the URL I gave you above.

bethskurrie
2020-01-13 21:19
Click on the NON-GET button next to the "self" relation, and send a DELETE request ot it.

justaburneremailforso
2020-01-13 21:19
Ok, thanks

bethskurrie
2020-01-13 21:19
I've just added this issue @justaburneremailforso ^^

justaburneremailforso
2020-01-13 21:20
Might be a nice feature to add to the broker UI, like a click and edit or delete function of some sort.

bethskurrie
2020-01-13 21:20
Yes, amongst many things!

justaburneremailforso
2020-01-13 21:25
Nice, thanks.

kevinkontcheu
2020-01-13 22:37
has joined #pact-broker

s1apped
2020-01-14 14:01
Hi. After publishing contract to pact-broker I'm seeing below message ```Note: this contract could not be parsed to a v1 or v2 Pact, showing raw content instead.``` and `Could not parse the following content to a Pact due to TypeError no implicit conversion of String into Integer, showing raw content instead` When I try to run provider verification it fails with below but when I run locally using @PactFolder everything works. ```http://au.com.dius.pact.provider.junit.MissingStateChangeMethod``` Do you have any idea what might the issue?

s1apped
2020-01-14 18:20
Looks like broker has some issues with regex / matchPath ```return builder .given("This is valid regex") .uponReceiving("Some test request") .matchPath("/test/1/regex/(this|that)") .method("GET") .willRespondWith() .status(200) .toPact();``` Above will cause issues for broker. When I replace matchPath with path it will work ```.path("/test/1/regex/this")```

bethskurrie
2020-01-14 19:40
@s1apped yeah, the display of v3 pacts is not working. Someone was going to find me an example so I could fix it, but they never got around to it. If you could PM me a redacted copy of yours, I'll fix it.

bethskurrie
2020-01-14 19:41
That has nothing to do with why it would pass locally and not from the broker though. It's just a display issue - the API works fine.

bethskurrie
2020-01-14 19:42
If you're able to make a github project to demonstrate the issue someone in pact-jvm might be able to help.

simone.cusimano92
2020-01-15 08:12
has joined #pact-broker

igalbenardete
2020-01-15 08:16
I had the same issue while I was generating Pact Files with the SBT plugin. The problem is that the generated JSON file does not have the following block: ``` "metadata": { "pactSpecification": { "version": "4.0.0" }``` Then I?ve added this manually and pushed it to the broker and it started parsing the JSON properly

simone.cusimano92
2020-01-15 08:25
Hi all, I'm looking for the Pact Broker on Docker Hub, but I'm getting a 404. Has it been moved? https://hub.docker.com/r/pactfoundation/pact-broker/

matt.fellows
2020-01-15 09:55
:point_up: that?s the correct one


bethskurrie
2020-01-15 09:56
It's there for me! Are you logged in?

bethskurrie
2020-01-15 09:57
The other day I was searching for an image, and it returned nothing until I'd logged in. I'm not sure why it shoes a search bar if you can't get results without logging in :man-shrugging:

simone.cusimano92
2020-01-15 10:37
Thank you guys! I log in and find it. It doesn't make sense to me either, but I take note of it :slightly_smiling_face:

nva
2020-01-17 09:54
has joined #pact-broker

brook
2020-01-17 17:08
has joined #pact-broker

adrian.mace
2020-01-21 03:35
Just looking to schedule in some maintenance on the Amazon RDS instance backing our pact-broker installation and looking for advice. This maintenance requires a reboot of the RDS instance to rotate the TLS CA certificate. The reboot is approximately 1 minute. Will pact-broker throw a fit or gracefully reconnect once the database reboots? Cheers :slightly_smiling_face:

bethskurrie
2020-01-21 03:42
Funnily enough, we've just been doing the CA updates ourselves today on some other systems.

bethskurrie
2020-01-21 03:43
I do not know the answer to that question. Let me try on my local machine and see what happens.

bethskurrie
2020-01-21 03:43
Which docker image are you using @adrian.mace? dius/pact-broker or pact-foundation/pact-broker?

adrian.mace
2020-01-21 03:43
checking

adrian.mace
2020-01-21 03:44
`dius/pact-broker:2.40.0-1`

bethskurrie
2020-01-21 03:44
Ok, so that's running Passenger. To my knowledge, it will just respawn new threads until the db comes up again.

matt.fellows
2020-01-21 03:45
obviously, take a backup of the RDS instance before you do this :stuck_out_tongue:

matt.fellows
2020-01-21 03:45
if you have a test environment, try it there

matt.fellows
2020-01-21 03:45
Just looking through our code commits for Pactflow to see if we?ve done anything specific for this change

bethskurrie
2020-01-21 03:45
I'm not actually sure if the passenger image will have the new CA certs however :thinking_face:

adrian.mace
2020-01-21 03:46
No problems, absolutely will do!

adrian.mace
2020-01-21 03:46
Does this service by default connect over TLS? :thinking_face:

bethskurrie
2020-01-21 03:46
So, you can test the restart using this docker compose file https://github.com/DiUS/pact-broker-docker-private/blob/master/docker-compose.yml

bethskurrie
2020-01-21 03:46
do `docker-compose up` then stop the database container

adrian.mace
2020-01-21 03:46
^ looks like the repo is private

bethskurrie
2020-01-21 03:46
then restart it. See what happens.

bethskurrie
2020-01-21 03:47
ha, sorry, wrong one


adrian.mace
2020-01-21 03:49
as far as I can tell, pact broker does not automatically connect over TLS? defaults to regular unencrypted connection?

bethskurrie
2020-01-21 03:51
Yes. I remember something about this. I didn't want to change the defaults in a way that would break existing deployments.

bethskurrie
2020-01-21 03:51
Ideally, it should default to TLS.

bethskurrie
2020-01-21 03:53
So, the pact-foundation/pact-broker image has support for ```PACT_BROKER_DATABASE_SSLMODE```

bethskurrie
2020-01-21 03:53
I'll need to back port it to the dius one.

adrian.mace
2020-01-21 03:55
the docker-compose file you linked gave us the confidence to run with it - looks like it should just handle it fine :slightly_smiling_face:

bethskurrie
2020-01-21 03:55
cool, I thought it would.

adrian.mace
2020-01-21 03:55
that's good to know, as long as it's not _currently_ using TLS I'm confident to upgrade the CA

bethskurrie
2020-01-21 03:55
We're just having an internal conversation about whether or not the docker image has the updated CA cert or not though. Ours "just worked" TM, but we're not sure how!

bethskurrie
2020-01-21 03:56
Pactflow runs on a fork of the OSS passenger image.

adrian.mace
2020-01-21 03:57
not sure how it's configured to connect when specifying SSLMODE but you won't have issues unless it's a) connecting via TLS and b) also performing strict CA verifications

adrian.mace
2020-01-21 03:57
you can connect to a database via TLS without verifying the CA - it's the same as connecting to a website with a self-signed certificate

bethskurrie
2020-01-21 03:58
I'm just looking up the sequel default ssl mode

kong
2020-01-21 03:59
When connecting to an RDS instance, AWS will automatically default to a non SSL mode connection if a) force_ssl is not on with RDS Parameter b) SSL mode is not specified in the client connecting in

kong
2020-01-21 03:59
It is always advisable to set `force_ssl` on RDS to on to force client SSL connections.

bethskurrie
2020-01-21 04:02
I've gone through postgres and pg gems, and they don't set a default sslmode. From https://ankane.org/postgres-sslmode-explained it seems the default is "prefer"

bethskurrie
2020-01-21 04:02
> This includes the default `prefer`

bethskurrie
2020-01-21 04:03
Ok, it's taken us a while, but we're on the same page as you now @adrian.mace

adrian.mace
2020-01-21 04:06
perfect, yep the `verify-ca` directive is what I was thinking of

kong
2020-01-21 04:12
ah, right. I forgot `verify-full` is not a default in SSL connections :facepalm:

matt.fellows
2020-01-21 04:17
For posterity, the latest `dius/pact-broker` image that I can pull via the docker registry has all of the latest AWS CA?s in the trust store

matt.fellows
2020-01-21 04:17
so `verify-ca` should be OK

sliu7
2020-01-21 04:19
has joined #pact-broker

sliu7
2020-01-21 04:21
Hey guys. I've been trying out some of the PactBroker webhooks and was trying to trigger a slack webhook when provider verification fails. When I test out the webhook using the execute endpoint, it works. But it doesn't seem to get triggered when the provider verification is failing in the CI pipeline. For the verification result, the 'Webhooks triggered by the publication of this verification result' is empty. Not sure if I'm missing some other config? Webhook configured: ```{ "description": "POST http://hooks.slack.com", "consumer": { "name": "TestConsumer" }, "provider": { "name": "TestProvider" }, "enabled": true, "request": { "method": "POST", "url": "slackwebhookurl", "headers": { "Content-Type": "application/json" }, "body": { "text": "Test pact verification failed" } }, "events": [ { "name": "provider_verification_failed" } ], "createdAt": "2020-01-20T23:53:23+00:00" }```

sliu7
2020-01-21 04:22
Where can I find the logs for the webhooks being triggered for each event?

bethskurrie
2020-01-21 04:22
are you using a docker image?

sliu7
2020-01-21 04:23
yup. Just checking.. the image version we're running is pactfoundation/pact-broker:2.37.0-1

bethskurrie
2020-01-21 04:25
Are you deployed in AWS?

sliu7
2020-01-21 04:26
no, Azure

bethskurrie
2020-01-21 04:26
You'll need to find out where Azure ships the logs to.

bethskurrie
2020-01-21 04:26
I'm afraid I can't help with that.

bethskurrie
2020-01-21 04:26
The logs go to stdout, and the container manager will send them somewhere.

sliu7
2020-01-21 04:27
Ok, I'll have a look. Thanks!

bethskurrie
2020-01-21 04:27
Oh - I can see the issue.


bethskurrie
2020-01-21 04:28
2.37 doesn't support that event.

bethskurrie
2020-01-21 04:28
I'm not sure why the validation even let you create the webhook.

bethskurrie
2020-01-21 04:28
You need 2.42.0 or later

sliu7
2020-01-21 04:29
Ok, cool. I'll try it with the latest version. Thanks a lot @bethskurrie!

bethskurrie
2020-01-21 04:29
np

v.melnychuk12
2020-01-21 07:59
has joined #pact-broker

s1apped
2020-01-21 13:56
Hi. do you have some examples (pipelines) how to properly setup CI with feature branches and Pact Broker?

jgfarias42
2020-01-22 09:51
has joined #pact-broker

bethskurrie
2020-01-22 21:55
@s1apped not a fully sophisticated one, but there is a simple demo. Let me find it.



bethskurrie
2020-01-22 22:05
That's not very helpful, now I look at the code


bethskurrie
2020-01-22 22:06
The key is tagging (in the broker) with the name of the git branch.

s1apped
2020-01-23 11:54
Hi. I have some problem with can-i-deploy --retry-while-unknown. Pact Publish triggers verification job via webhook but can-i-deploy doesn't wait for verification to be completed. Please see below: ```sh "docker run --rm pactfoundation/pact-cli:latest broker can-i-deploy --retry-while-unknown=10 --retry-interval=30 -b http://10.0.0.0 -a ${env.SERVICE_NAME} -e ${env.GIT_COMMIT}"``` ```Computer says no ¯\_(?)_/¯ No pacts or verifications have been published for version ....``` Once verification job is completed contract is verified.. I'm using pact Broker 2.43.0-1. Any ideas? Thanks

anja.kammer
2020-01-23 12:03
has joined #pact-broker

ankit992
2020-01-23 17:04
has joined #pact-broker

g.van.vliet
2020-01-24 13:13
has joined #pact-broker

hidalgofdz
2020-01-26 01:12
has joined #pact-broker

antonello
2020-01-27 14:12
@bethskurrie When you have a chance, could you publish the docker images for v2.44, please? :slightly_smiling_face:

bethskurrie
2020-01-27 21:06
Sure @antonello I'll put it out today

bethskurrie
2020-01-27 23:41
Done @antonello

antonello
2020-01-28 06:51
Thanks!

adrian.mace
2020-01-28 22:24
Hi, does this commit mean that a new field is required as of the recent version? or does it also come with a default value? Would this affect consumers uploading pacts or producers downloading and running against them? https://github.com/pact-foundation/pact_broker/commit/ebbbbec9

bethskurrie
2020-01-28 22:43
It's for a new api that's only being used in beta, and only currently enabled in http://pactflow.io so it won't affect general users @adrian.mace

bethskurrie
2020-01-28 22:44
Thanks for for reminding me though, I need to reverse that change now, as I'm adding support for "all pacts for a given tag" in the service.

adrian.mace
2020-01-28 23:12
ah fantastic! glad I could help lol so in terms of updating pact broker, should be no breaking changes then!

bethskurrie
2020-01-29 04:21
I will never make a breaking change to a publicly released endpoint unless it's a major version bump @adrian.mace.

bethskurrie
2020-01-29 04:23
And we haven't had one of those yet!

adrian.mace
2020-01-29 05:22
:smile:

g.j.crossfield
2020-01-29 17:01
has joined #pact-broker

jana.pacheco
2020-01-29 17:09
has joined #pact-broker

sagupta
2020-01-29 21:06
has joined #pact-broker

bethskurrie
2020-01-30 00:17
@antonello grab 2.45.0-1 as there was a bug in the logic for can-i-deploy introduced when I added support for using multiple selectors with a `--to ENV`

elitusprime
2020-01-30 16:02
has joined #pact-broker

bheemreddy181
2020-01-31 01:25
Hey Team , I am trying to run https://github.com/pact-foundation/pact-broker-docker/blob/master/script/test.sh on a linux machine having issues with Dockerfile, Can somee one help ?

bheemreddy181
2020-01-31 01:26
```bvennapureddy@pact_broker:~$ ./test.sh Will build the pact broker unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /home/bvennapureddy/Dockerfile: no such file or directory```

bheemreddy181
2020-01-31 01:26
in my root folder i don't see a Dockerfile in general

bethskurrie
2020-01-31 01:27
It's in the repository!

bethskurrie
2020-01-31 01:27
Not sure why you can't see it.


bheemreddy181
2020-01-31 01:32
Well do i need to fork the repo ? i was in an assumption that i need to pull the docker image and then set the Env variables and then just run test.sh

bethskurrie
2020-01-31 01:32
No, you just need to clone it.

bethskurrie
2020-01-31 01:33
git@github.com:pact-foundation/pact-broker-docker.git

bethskurrie
2020-01-31 01:33
cd pact-broker-docker

bethskurrie
2020-01-31 01:34
docker-compose up

bethskurrie
2020-01-31 01:34
How did you fix an issue with it without having run it?

bheemreddy181
2020-01-31 01:34
got it thanks

bheemreddy181
2020-01-31 01:35
which one you mean ?

bheemreddy181
2020-01-31 01:35
well i was using the free version hosted by dius

bheemreddy181
2020-01-31 01:35
now i was in a plan to bring our own version of it

bheemreddy181
2020-01-31 01:39
that worked thanks @bethskurrie the saviour

bheemreddy181
2020-01-31 01:40
```postgres_1 | 2020-01-31 01:36:56.797 UTC [58] ERROR: relation "schema_migrations" does not exist at character 27 postgres_1 | 2020-01-31 01:36:56.797 UTC [58] STATEMENT: SELECT NULL AS "nil" FROM "schema_migrations" LIMIT 1 postgres_1 | 2020-01-31 01:36:56.807 UTC [58] ERROR: relation "schema_info" does not exist at character 27 postgres_1 | 2020-01-31 01:36:56.807 UTC [58] STATEMENT: SELECT NULL AS "nil" FROM "schema_info" LIMIT 1``` Do i need to worry about the above errors ?

bethskurrie
2020-01-31 01:40
no

bethskurrie
2020-01-31 01:40
it's just how sequel works out if the table exists or not

bethskurrie
2020-01-31 01:40
it tries to query it

bheemreddy181
2020-01-31 01:41
Got it :slightly_smiling_face:

bheemreddy181
2020-01-31 01:41
thanks for the Help , have a great day

bethskurrie
2020-01-31 01:41
Do you mind if I ask what you are your reasons for running your own broker @bheemreddy181?

bheemreddy181
2020-01-31 01:41
II recently gave a presentation and it was well-received they want me to bring these things up

bheemreddy181
2020-01-31 01:42
well they want to see the usage and then think about the paid version of it

matt.fellows
2020-01-31 01:42
If you want us to increase the limits on your free one to avoid you having to spend time setting up an on-prem one, let us know

bheemreddy181
2020-01-31 01:43
Once it is built into CICD pipeline migration will not be a problem i feel

matt.fellows
2020-01-31 01:43
possibly, webhook executions can sometimes present challenges. Also you don?t have secrets in the OSS one, so you would need to recreate all of those etc.

bheemreddy181
2020-01-31 01:44
sure but for now they don't want to talk to outside systems some kind of compliance stuff

matt.fellows
2020-01-31 01:44
haha fair enough

bethskurrie
2020-01-31 01:44
strangely enough, we're just looking at building an on-prem version of Pactflow.

bheemreddy181
2020-01-31 01:45
Ah Cool , Something to look into

bethskurrie
2020-01-31 01:45
we'll keep you updated.

bheemreddy181
2020-01-31 01:46
It would be great if you people can start some good presentations on Async Systems

matt.fellows
2020-01-31 01:46
it would indeed

matt.fellows
2020-01-31 01:47
what tech specifically? I know you guys use Ruby, what async - e.g. websockets, kinesis, kafka? ?

bheemreddy181
2020-01-31 01:47
And Some presentations on how we can easily push this into Any CICD pipeline

bheemreddy181
2020-01-31 01:47
We use AWS and Kafka

matt.fellows
2020-01-31 01:48
I?m ok with this. Just don?t tell me you use Jenkins

bheemreddy181
2020-01-31 01:48
We use travis and Jenkins

bheemreddy181
2020-01-31 01:49
And Mainly alll GOOOOOOOlang

matt.fellows
2020-01-31 01:50
oh right, I thought you guys were Ruby

bheemreddy181
2020-01-31 01:50
We use both , but all new services in Golang

matt.fellows
2020-01-31 01:50
In any case, we?ve recently put together a Kinesis workshop for Golang. It?s basically the same for Kafka, so that might be helpful

matt.fellows
2020-01-31 01:50
I need to get permission to publish it because it was with a client

bheemreddy181
2020-01-31 01:51
Oh Cool Will be waiting for it

matt.fellows
2020-01-31 01:51
It?s the project that works along side https://github.com/pact-foundation/pact-workshop-go/

bheemreddy181
2020-01-31 01:59
How easy are the Upgrades for docker image ?

bethskurrie
2020-01-31 02:01
Very. You just update the number.

justaburneremailforso
2020-01-31 09:30
Hello, if I have a provider with multiple consumers, how do I run can I deploy on all the consumers? I have a sample set up and from the documentation it seems like I can just pass in multiple consumers like this "can-i-deploy -a consumer1 -l -a consumer2 -l -a consumer3 -l" etc. However if I run this, I get a message saying "there are no missing dependencies" and passed even though verification has failed on them all and it shows that on the broker. If I change the command to specify one consumer, it works as expected and fails saying verification has failed. Is there a way to specify multiple consumers in one can-i-deploy command? Thanks!

bethskurrie
2020-01-31 09:39
There was a bug that I've just fixed with the matrix, like, yesterday

bethskurrie
2020-01-31 09:39
You might need to upgrade

justaburneremailforso
2020-01-31 09:40
Ah ok. Is that why can I deploy passes if you pass in multiple consumers to the command?

bethskurrie
2020-01-31 09:41
Well, it doesn't make sense to me, but it definitely can't hurt!

bethskurrie
2020-01-31 09:42
I'm confused as to why you're tyring to deploy 3 consumers together.

justaburneremailforso
2020-01-31 09:43
Well I'm approaching it from a provider perspective. The provider wants to run can I deploy on all its consumers before the provider deploys

bethskurrie
2020-01-31 09:43
So, if you just list pacticipants with no "to" then it only looks at integrations that only have the applications you specified

bethskurrie
2020-01-31 09:44
You need to include the provider in there

bethskurrie
2020-01-31 09:44
Really, you need to use tags and just give it the provider name, but maybe you have some reason for doing it manually?

justaburneremailforso
2020-01-31 09:46
I'm still learning how to use it correctly/fully, sounds like I need to tweak my command and use tags

bethskurrie
2020-01-31 09:46
If you specify one consumer, it automatically calculates the dependencies. Because you're specifying multiple, you're in "manual mode".



bethskurrie
2020-01-31 09:48
Sorry, stupid auto expand. I can't remove it on mobile.

justaburneremailforso
2020-01-31 09:50
Yeah been reading those but might have missed something.

bethskurrie
2020-01-31 10:22
Tagging with "prod" on deploy, and then using "can-i-deploy -- pacticipant Foo -- version 123 -- to prod" is the most common and easiest way to do it.

bethskurrie
2020-01-31 10:22
The broker knows what's in prod and calculates your dependencies for you.

justaburneremailforso
2020-01-31 10:22
Ok, sounds easy enough, thanks.

bheemreddy181
2020-01-31 13:25
Number in docker-compose ?

matt.fellows
2020-01-31 22:23
Yeah, we have incremental build numbers so just pull the latest and you should be golden. Of course, always take a RB snapshot etc just in case

matt.fellows
2020-01-31 22:23
DB*

bethskurrie
2020-02-02 19:57
Typically you don't run docker compose in production @bheemreddy181. You'd use something like Fargate, or Kubernetes. The number were talking about is the tag. It looks like 2.46.0-1 for the Pact Broker.

matt.fellows
2020-02-02 22:43
Unless you run Docker Enterprise :laughing:

matt.fellows
2020-02-02 22:43
(but of course you don?t, because nobody does - that?s why Mirantis bought them out?)

bheemreddy181
2020-02-03 03:07
Well smaller companies like us can?t still do a docker compose unless there is a need for it to scale ? @bethskurrie @matt.fellows

bethskurrie
2020-02-03 04:19
It's not so much about scale as I'm not sure that using docker compose is the right way to run a production system. For example, you don't want the database to disappear when you do docker-compose down. You want it to be monitored, and for it to come back up if the process goes down. You need to give it a proper hostname and SSL certificate and make sure it's deployed in a network that's accessible from CI systems... it's not just a matter of running 'docker-compose up' on a developer's machine somewhere.

matt.fellows
2020-02-03 10:52
haha no of course not. You can choose what you want, I just wouldn?t recommend it for a ?production grade? system.

matt.fellows
2020-02-03 10:52
(I was making a dig at Docker who, despite creating the technology, was unable to really capitalise on the commercial front)

bheemreddy181
2020-02-03 14:40
That makes complete sense, what I mean is just use docker compose but connect to remote host database . In which you will not have a database going down which is still accessible

bheemreddy181
2020-02-03 14:45
Quick question : when ever we run contract tests form either side ( consumer or provider ) the idea is to run can-I-deploy separately as a different job rather than hooking it with contract generation , publishing and running provider job on consumer / pulling contracts , verifying contracts and provider

simone.cusimano92
2020-02-03 16:01
Hi all, why is the v2.47.1 pactbroker's docker image not yet on the Docker Hub?

bethskurrie
2020-02-03 20:48
I'll put it out today @simone.cusimano92. There's only a very small bug fix that's unlikely to affect you.


bethskurrie
2020-02-03 20:50
The pact tests generally run after the unit tests, and before deploying. Can I deploy runs before deploying.

simone.cusimano92
2020-02-03 20:50
Thank you very much Beth!

bheemreddy181
2020-02-03 20:52
We want this before merge post merge we want to deploy , we want the feedback loop faster

matt.fellows
2020-02-03 22:30
What?s the actual question Bheem?

matt.fellows
2020-02-03 22:30
Are you asking if your statement is recommended?

bethskurrie
2020-02-03 22:32
> we want the feedback loop faster You can publish your pact statuses to github and make them a requirement for merging http://blog.pact.io/2018/07/16/publishing-pact-verification-statuses-to-github/

bethskurrie
2020-02-03 22:32
If you do this, make sure you upgrade to the very latest docker image, as I've just released a bug fix related to this.

bethskurrie
2020-02-03 22:55
Building now @simone.cusimano92

bethskurrie
2020-02-03 22:55
It'll be hot off the press in about 3 minutes.

bheemreddy181
2020-02-03 23:00
@matt.fellows my actual question was more like I want the trigger point to be part of of GitHub Pull request for the contracts tests to run along with your unit tests + functional test + anything else lets take an example 1. From consumers perspective- consumer uploads a contracts as part of new pull request then which triggers a job on provider to pull the contract and verify it all this is initiated by one job which is part of Travis or Circle CI

bheemreddy181
2020-02-03 23:02
Now do I have another job on github as part of my Travis or Jenkins run which will just run can-I-deploy which is inter-dependent on the above run and it?s typically waiting because of jobs triggered parallel

bethskurrie
2020-02-03 23:03
I'm still not sure what you're asking.

bethskurrie
2020-02-03 23:03
maybe it would make sense if you drew us a diagram, and then explained where the problem was.

matt.fellows
2020-02-03 23:11
If the feedback loop is what you?re after, `can-i-deploy` should be run on all builds - branches included. This way, you have the feedback prior to merge. As Beth mentioned, you can hookup github statuses also

matt.fellows
2020-02-03 23:12
It is common to setup a specific provider build that _just_ performs the Pact verification for a given contract, triggered by a Webhook. I wouldn?t have can-i-deploy as a separate thing

bheemreddy181
2020-02-03 23:34
Ok will draw something and put it here

bheemreddy181
2020-02-04 00:42
So when I use this http://blog.pact.io/2018/07/16/publishing-pact-verification-statuses-to-github/ there is no need of a can-i-deploy tool, I will end up having my job waiting for the provider to verify and publish the results back to consumer CI from broker

bethskurrie
2020-02-04 00:43
you'll want can-i-deploy for deployments to an environment, but the git statuses should remove the need to use can-i-deploy for PRs.

bethskurrie
2020-02-04 00:44
Also, if your verifications are taking that long, it suggests to me that you might be running the entire verification suite instead of just verifying the pact that has changed?

bheemreddy181
2020-02-04 00:44
once my PR is green I will go ahead and merge my PR there ends the loop?

bethskurrie
2020-02-04 00:45
do you have multiple branches of the provider publishing verifications?

bheemreddy181
2020-02-04 00:45
no only master

bethskurrie
2020-02-04 00:45
should be fine then.

bethskurrie
2020-02-04 00:46
once master has verified the pact, the status will be reported back to Github, and the PR should be green.

bheemreddy181
2020-02-04 00:47
perfect that will eliminate the use of can-i-deploy

bethskurrie
2020-02-04 00:47
For it to work properly thought, you need to be using the pact URL that comes from the webhook to verify thought, as it contains metadata in it that will make the verification result come back to the right commit.

bethskurrie
2020-02-04 00:49
remember, verification results belong to the *content* of the pact, not the consumer version, so if your pact content has been published by many consumer versions, then it will just do the github status update for the most recent consumer version unless you verify the pactURL that is supplied from the pact changed webhook.

bheemreddy181
2020-02-04 00:49
So on the provider side, we will have pact verification job itself to tell whether anything is broken and we can eliminate can-i-deploy there as well ?

bheemreddy181
2020-02-04 00:50
multiple consumer versions can end up having the same content if the pact is not changed

bheemreddy181
2020-02-04 00:56
This is what you mean correct ?

bheemreddy181
2020-02-04 00:57
well there is no fetch results at the end on the consumer side because the webhook itself can update the status back on consumer CI either red/green

bheemreddy181
2020-02-04 14:28
Can you please elaborate what do you mean by verifying pactURL ?

bethskurrie
2020-02-04 19:55
The "contract changed" webhook has parameters like the consumer name, provider name etc that you can use in the body of the webhook. There's also a url of the Pact that has changed. That url has some metadata in it (the current tags and the consumer version number). That url should be passed through to the verification job, and for a speedy feedback loop, only that pact should be verified.

bethskurrie
2020-02-04 19:56
When the verification results are posted back, it will know which consumer version number the results belong to.

bethskurrie
2020-02-04 20:00
If you just do the normal "verify all", it will firstly, take a long time, and secondly, if the pact content has been published by many consumer versions, it will send the results back to the *last* consumer version, which may or may not be the one you want. If you've pushed the pact multiple times before the results come back (eg you did a push 1 minute apart, and the verification results took 3 minutes to come back) then your original commit won't get its results - only the second one will.

shilpa3006
2020-02-04 23:10
Hi, we are interested in pact broker and looking forward to push pact broker to PCF(Pivotal Cloud Foundation) and we are not encouraged to use docker. Can I know how can I do that and what all I would need?

matt.fellows
2020-02-04 23:12
Are you asking how to run a Ruby Rack app in Production?

shilpa3006
2020-02-04 23:21
Yes

shilpa3006
2020-02-04 23:22
In pcf

matt.fellows
2020-02-04 23:24
I?m afraid you?re unlikely to get any help from the core maintainers. We don?t use PCF here and recommend generally going down the container path

matt.fellows
2020-02-04 23:25
There is no reason why it shouldn?t work on PCF though


matt.fellows
2020-02-04 23:27
Then it?s just a matter of exporting any environment variables and/or modifying `http://config.ru` to suit your needs


shilpa3006
2020-02-04 23:29
Awesome

shilpa3006
2020-02-04 23:29
Thanks much

shilpa3006
2020-02-04 23:43
Another dumb question. As this is not docker solution, what all prerequisites needed for pact broker up and running in pcf

shilpa3006
2020-02-04 23:45
Can I setup locally first make sure app is working and then push to pcf

shilpa3006
2020-02-04 23:45
Any instructions?

matt.fellows
2020-02-04 23:45
What have you tried so far?

shilpa3006
2020-02-04 23:46
Tried docker solution got rejected

shilpa3006
2020-02-04 23:46
Nothing after that

matt.fellows
2020-02-04 23:47
k


matt.fellows
2020-02-04 23:47
there are examples there

matt.fellows
2020-02-04 23:47
(that don?t need docker)


shilpa3006
2020-02-04 23:51
Rolling your own is wat we r interested in

shilpa3006
2020-02-04 23:51
Gone thru this

shilpa3006
2020-02-04 23:52
But instructions are not that clear

bethskurrie
2020-02-04 23:52
I'm afraid you'll need a dev ops type person.

matt.fellows
2020-02-04 23:53
and/or a Ruby expert

matt.fellows
2020-02-04 23:54
You can run it locally without having to do anything (see this example: https://github.com/pact-foundation/pact_broker/blob/master/README.md#to-have-a-play-around-on-your-local-machine) , but to run anything in Production you?re probably going to need to harden it for your environment, something which we can?t tell you how to do from here

shilpa3006
2020-02-04 23:56
Thanks Matt. I will try this locally on my machine first.

kong
2020-02-05 00:01
I?ve not used PCF with the ruby buildpack but I believe it will automatically read the Gemfile and lockfiles to build it?s package. You will need to setup your database separately though

bethskurrie
2020-02-05 00:01
Ken to the rescue!

shilpa3006
2020-02-05 02:09
Thanks a lot. This helps.

bheemreddy181
2020-02-05 04:13
makes complete sense

bheemreddy181
2020-02-05 15:59
Once the pact is green on PR , we have to tag the pact as master on the merge correct , so that provider verification can always verify master on the provider PR ?

sagupta
2020-02-05 16:16
Hello Team, May be a repeated question. I am doing the pact-js workshop and I want to use PACT broker. However from the documentation , looks like either I can use the pact broker hosted or on my local machine or a docker image? I am guessing , I need to buy a subscription if i use the hosted pact broker so May i know which is the recommended method if I want to try it out first to do a POC? Also any documentation link for easy setup will be helpful

uglyog
2020-02-05 20:51
@sagupta you can sign up for a free one at http://pactflow.io

sagupta
2020-02-05 21:05
Ok and is this recommended way for executing actual tests ?

sagupta
2020-02-05 21:05
Like in production

sam774
2020-02-05 21:12
Perhaps a dumb question, but does the pact broker docker create the database schema upon first startup? I'm just wondering as in gcp I've hooked up pact broker with cloud SQL proxy to a postgres database and I can see it connecting, but there's nothing in the db

bethskurrie
2020-02-05 21:13
yes

bethskurrie
2020-02-05 21:14
You either need to run and support your own broker or use pactflow @sagupta

bethskurrie
2020-02-05 21:15
when you say "the schema", what exactly do you mean? (the term "schema" is overloaded)

bethskurrie
2020-02-05 21:15
You need to create the database already, but it will create the tables and views.

matt.fellows
2020-02-05 21:16
The workshop has documentation for how to run locally. The hosted broker will have a public URL and you'll need to grab a token from the settings page

sam774
2020-02-05 21:16
Yeah I mean exactly that

sam774
2020-02-05 21:16
I must have goofed up somewhere then


bheemreddy181
2020-02-06 23:25
@bethskurrie ^ is this true ?

bethskurrie
2020-02-06 23:26
When you merge, do you have a merge build?

bethskurrie
2020-02-06 23:27
In my experience, there would be a build that runs on master after the merge. It would be the one that publishes the pact and tags it with master.

bethskurrie
2020-02-06 23:28
It should have the same content as the one from the PR, so it will inherit the previous verification status.

bheemreddy181
2020-02-06 23:29
Yes there will a build on travis post-merge on master and the content will be same

bethskurrie
2020-02-06 23:29
cool, well, just let it do its thing.

bheemreddy181
2020-02-06 23:30
So tagging it as master should only happen on master not on the PR ?

bheemreddy181
2020-02-06 23:32
@bethskurrie ^

matt.fellows
2020-02-07 00:28
yes, I would tag it `master` when it?s actually on `master`

bheemreddy181
2020-02-07 05:02
Any idea we can pass parameters for triggering a travis build from the webhook by passing the path pramaters similar to jenkins as below , i don't see anything the documentation ```http://jenkins:8080/job/<provider-job-name>/buildWithParameters?pactConsumerTags=${pactbroker.consumerVersionTags}```

bethskurrie
2020-02-07 05:38
Sorry, I don't understand the question.


bheemreddy181
2020-02-07 14:43
Jenkins support path parameters where as Travis doesn?t support that I am asking if you anyone tried using Travis for passing path variables or some other way

justaburneremailforso
2020-02-07 15:13
Hello, I have a quick question about the broker and Can I Deploy. If we make a consumer contract change and publish it to the broker, we can see the status changes to "Pact has changed since last successful verification" and the last verified status changes to yellow. Provider verification has not been re-run since the contract changed. If I run Can I Deploy now, it passes. Is that expected behaviour? In that can I deploy only fails when verification has never happened or when verification has failed? In the scenario above where the last verify status has changed but is not failed, can I deploy will pass? Thanks

bheemreddy181
2020-02-07 16:20
@justaburneremailforso did you already set up your webhook for triggering the job on the provider, if so when contract changes the job should be triggered. how are you running your can-i-deploy?

bheemreddy181
2020-02-07 16:21
Team any idea i am getting 405 response when executing the webhook from broker , this is what i see in the logs

bheemreddy181
2020-02-07 16:21
```nginx_1 | 10.226.32.51 - - [07/Feb/2020:16:16:47 +0000] "GET /webhooks/ENdZ3UmsnibGo-05_YRAKw/execute HTTP/1.1" 405 0 "http://pact_broker.dev.com/hal-browser/browser.html" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" "-"```

bheemreddy181
2020-02-07 16:31
this is what i did for white_listing on the docker image ```PACT_BROKER_WEBHOOK_HOST_WHITELIST="http://travis.staging.sample.com","http://travis.sample.com","http://pipeline.sample.com","http://jenkins.sample.com","http://git.sample.com","http://slack.sample.com"```

bheemreddy181
2020-02-07 16:32
i did docker-compose down and did bring it up again

kulik.olenka
2020-02-07 21:02
has joined #pact-broker

matt.fellows
2020-02-07 22:21
405 is method not allowed. I can?t remember off the top of my head, but that is probably a `POST` instead of a `GET`

justaburneremailforso
2020-02-07 22:50
Yeah we have a webhook but was wondering what should happen if the contract has changed but verify hasn't run yet.

bheemreddy181
2020-02-07 23:14
@matt.fellows I see that response when I try to execute the webhook manually to verify if that?s working

bheemreddy181
2020-02-07 23:14
On pb:execute

bheemreddy181
2020-02-07 23:22
It depends on which version of consumer you are running your can-I-deploy on

bheemreddy181
2020-02-07 23:23
What I will do is record a session to explain more what?s going wrong here

bethskurrie
2020-02-08 03:25
It depends on the tags @justaburneremailforso

bethskurrie
2020-02-08 03:25
The status you're going to see is for the very latest pact.

bethskurrie
2020-02-08 03:25
But if you're doing can-i-deploy on a different version, you'll get different results.

bethskurrie
2020-02-08 03:26
Have a look at the matrix page rather than the index - it might be clearer.

bethskurrie
2020-02-08 03:27
If you can recreate the scenario and post some screenshots we might be able to work it out.

bethskurrie
2020-02-08 03:28
The output from can-i-deploy will tell you which consumer/provider versions it thinks are applicable. Check those versions and see if they make sense.

bethskurrie
2020-02-08 03:29
@bheemreddy181 Please read the documentation more closely. `PACT_BROKER_WEBHOOK_HOST_WHITELIST - a space delimited list of hosts`

bethskurrie
2020-02-08 03:30
You have not got a space delimited list of hosts there.


bheemreddy181
2020-02-08 03:32
without any quotes you mean ?

bethskurrie
2020-02-08 03:33
does it mention quotes?

bethskurrie
2020-02-08 03:33
does it mention commas?

bethskurrie
2020-02-08 03:33
no - it says "space delimited"

bethskurrie
2020-02-08 03:33
that means there is a space between each host.

bethskurrie
2020-02-08 03:33
I don't know how to make that any clearer


bethskurrie
2020-02-08 03:35
THat is for the Ruby code.

bethskurrie
2020-02-08 03:35
You have an environment variable.

bethskurrie
2020-02-08 03:35
You are running a docker container.

bheemreddy181
2020-02-08 03:35
makes sense :+1:

bethskurrie
2020-02-08 03:35
:thumbsup::skin-tone-3:

bheemreddy181
2020-02-08 03:58
whenever i bring down the docker image and bring it back up I don't see the old pact files, is there something i am doing wrong

bethskurrie
2020-02-08 03:59
have you given it a permanent database?

bheemreddy181
2020-02-08 03:59
a remote database you mean ?

bethskurrie
2020-02-08 03:59
yes. one that's not in the docker-compose file

matt.fellows
2020-02-08 03:59
Just any persistent database. Whether locally or remote

matt.fellows
2020-02-08 04:00
It can be in the docker compose file, but you need to persist volumes and things

bheemreddy181
2020-02-08 04:00
nope , i was in an assumption it brings the data back up from the existing postgres file on the machine

matt.fellows
2020-02-08 04:00
Don't use the sqlite

matt.fellows
2020-02-08 04:01
You'll need to check the postgres rocker docs to ensure you persist any volumes. Otherwise they'll disappear

matt.fellows
2020-02-08 04:01
Docker*

bethskurrie
2020-02-08 04:01
Is there a developer from your company who can pair with you on this?

bethskurrie
2020-02-08 04:02
Trying to teach someone how to use Docker is beyond what we're really able to do over this channel.

bheemreddy181
2020-02-08 04:02
yes, there are, I will get in touch with someone for sure :slightly_smiling_face:

bethskurrie
2020-02-08 09:11
Do you mean dynamic job parameters in the request? Yes, you an definitely do that.


bethskurrie
2020-02-08 09:21
You use environment variables.

bethskurrie
2020-02-08 09:21
```{ "env": [ "NAME=value" ] }```

sliu7
2020-02-10 02:49
Hi guys. I'm trying to use the pact broker CLI - installed the latest version (tried pact-1.77.0 and pact-1.78.0) for windows. I had a read through selectors (https://docs.pact.io/pact_broker/advanced_topics/selectors) and thought that by specifying --consumer-version-selector, it should verify only consumer contracts with the specified tag in the selector. However, it seems to be verifying the latest version irrespective of what tag I provide. Am I missing something? Eg: I have a consumer for a provider with 2 tags - the provider verification is successful for consumer contract with 'master' tag but fails for the contract with 'test' contract 1. pact-provider-verifier --provider-base-url=https://localhost:5001 --pact-broker-base-url=<<broker-url>> --provider=SampleProvider --consumer-version-tag=master [*Verification successful*] 2. pact-provider-verifier --provider-base-url=https://localhost:5001 --pact-broker-base-url=<<broker-url>> --provider=SampleProvider --consumer-version-selector='{"tag": "master", "latest": true}' [*Verification failed*. I thought that this should give a successful verification since it should filter based on the latest contract with master tag] 3. pact-provider-verifier --provider-base-url=https://localhost:5001 --pact-broker-base-url=<<broker-url>> --provider=SampleProvider --consumer-version-selector='{"tag": "test123", "latest": true}' [*Verification failed*. I thought that this should give an error relating to could not find contract since I don't have any contract with the corresponding tag]

bethskurrie
2020-02-10 02:49
@sliu7 you're using a feature that's not publicly released in the OSS yet.

bethskurrie
2020-02-10 02:50
Please just use --consumer-version-tag for now.

sliu7
2020-02-10 02:50
Ah ok, my bad. Thanks!

bethskurrie
2020-02-10 02:51
It should be out soon. We need to get pact-jvm using it before we go public, because at the moment, we're doing a beta with the ruby clients, but we need to make sure pact-jvm can use the api before we go public, in case there has to be breaking changes.

sliu7
2020-02-10 02:52
yup, will just use --consumer-version-tag for now. Thanks :slightly_smiling_face:

matt.fellows
2020-02-10 11:50
What languages are you using Shiraine? It will be supported in Pact Go in the next couple of days, and in JS in the next few weeks

bethskurrie
2020-02-10 22:00
But only if you're using pactflow as the back end

matt.fellows
2020-02-10 22:50
oh yes, that too

sliu7
2020-02-10 23:13
Mainly using C# right now, but no, we're not using pactflow as the back end

paul.white
2020-02-11 09:04
has joined #pact-broker

justaburneremailforso
2020-02-11 13:02
Hello, I am currently writing a pact Kafka consumer test and when I publish it to the broker and examine it on the broker there's a message that says "Note: this contract could not be parsed to a v1 or v2 pact, showing raw content instead". I'm using pact-jvm-consumer-junit_211 version 3.5.0 in my pom file. I'm also using pact-jvm-provider-maven_2.12 version 3.5.11 as a plugin in my pom file. Does anyone know why I am getting that message? Is it because of some issue with the versions I am using in my pom and/or the broker version or something else? Thanks.

uglyog
2020-02-11 21:05
What version of the pact broker are you using?

shilpa3006
2020-02-12 03:26
@matt.fellows @bethskurrie Thanks Matt and Beth for your inputs. I am able to setup pact broker on my machine.

bethskurrie
2020-02-12 03:41
It actually used to display, and then it stopped at some version for some reason. People kept reporting it, but then not supplying me with an example of the Pact that caused it.

bethskurrie
2020-02-12 03:41
I'll have a look at it tomorrow, because there's another v3 parsing bug that someone has raised for the stub service.

justaburneremailforso
2020-02-12 08:47
I'm not sure what version of the broker we have. Is there a way for me to check through the UI?

justaburneremailforso
2020-02-12 09:07
We are using version 2.48.0-1 of the broker.

ahmadw
2020-02-12 11:33
has joined #pact-broker

ahmadw
2020-02-12 11:33
```@PactBroker(host = "http://mashreq.pact.dius.com.au/", port = "8089", protocol = "https", authentication = @PactBrokerAuth(username = "Read/Write Toke", password = "abcd"))``` I am getting 401 error for this Pactbroker configuration, can anyone help


ahmadw
2020-02-12 12:19
https://docs.pact.io/getting_started/sharing_pacts Pact-JVM Junit According to documentation, how can i publish pact file to PactBroker for verification from provider?


ileshdarji
2020-02-12 18:10
has joined #pact-broker

justaburneremailforso
2020-02-12 19:11
Our pact is quite basic, it's something like this: ```@Pact(provider = "provider", consumer = "consumer") public MessagePact testPact(MessagePactBuilder builder) { PactDslJsonBody body = new PactDslJsonBody() .stringType("test", "item") .integerType("number", 1234); return builder .expectsToReceive("test message") .withContent(body) .toPact(); }```

uglyog
2020-02-12 21:41
Don't use username and password if you're using a token

bheemreddy181
2020-02-13 04:06
one last question here if you don?t mind given the contract creation and publish job are technically synchronous but it?s still not a blocking call as per the below picture how will my job on GitHub will be waiting for the results to comeback even if I am using publishing verifications status from GitHub using http://blog.pact.io/2018/07/16/publishing-pact-verification-statuses-to-github/

bethskurrie
2020-02-13 04:07
You don't typically wait.

bethskurrie
2020-02-13 04:07
You go straight on to can-i-deploy, and that either aborts your pipeline (because the pact hasn't been verified) or keep going because it is.

bethskurrie
2020-02-13 04:08
If you want to tell it to wait for the verification results to come back, you can tell it to wait and poll.



bethskurrie
2020-02-13 04:12
Well, you could write a script to poll github instead?

bheemreddy181
2020-02-13 04:13
Ah makes sense slightly confused :man-shrugging::skin-tone-2:

bethskurrie
2020-02-13 04:13
You said you wanted to wait for something

bethskurrie
2020-02-13 04:13
What are you waiting to do?

bheemreddy181
2020-02-13 04:14
Typically I don?t want my PR checks to go green even before provider verification job completes

bethskurrie
2020-02-13 04:14
well, if it's pre-verified, it's going to go green.

bethskurrie
2020-02-13 04:14
why is that a problem?

bheemreddy181
2020-02-13 04:15
That?s true but if it is not (not pre-verified) I should poll for the initial integration

bheemreddy181
2020-02-13 04:15
I am all taking in terms of initial Integration

bethskurrie
2020-02-13 04:16
why would it go green before the verification had finished?

bethskurrie
2020-02-13 04:16
if you have a contract_published webhook, it will send 'pending' if it's not verified yet.

bethskurrie
2020-02-13 04:17
it will only go green once the provider_verification_published webhook fires and updates the status to success.

bheemreddy181
2020-02-13 04:17
I don?t see pact:publish job waiting when I run this locally with all the webhook integration present

bethskurrie
2020-02-13 04:18
no...

bethskurrie
2020-02-13 04:18
it doesn't...

bheemreddy181
2020-02-13 04:18
You mean it doesn?t wait or it should wait :expressionless:

bethskurrie
2020-02-13 04:19
I'm so confused too!

bethskurrie
2020-02-13 04:19
It doesn't wait

bethskurrie
2020-02-13 04:19
That diagram is misleading.


bheemreddy181
2020-02-13 04:20
:confused::confused::confused: I know I am eating all your brain I have demo due for this Friday I want to be slightly clear with what I present for my deployment team so

bethskurrie
2020-02-13 04:20
I don't know what your pipeline is, so it's hard to help

bethskurrie
2020-02-13 04:21
usually, you'd go "unit test, pact tests, can-i-deploy to test, deploy to test, can-i-deploy to prod, deploy to prod"

bethskurrie
2020-02-13 04:21
those would be steps in your pipeline

bethskurrie
2020-02-13 04:22
on a branch, the can-i-deploy to test would stop you deploying an unverified pact to the test env if you had new functionality.

bheemreddy181
2020-02-13 04:23
usually, my PR checks goes this way "unit test, pact tests, dB lints " with in my pact tests it will ? create contract , publish contract ? this is what I expected with all webhooks in place

bethskurrie
2020-02-13 04:23
if you wanted to poll in can-i-deploy, it would wait for however long you wanted for the successful verification to come back.

bethskurrie
2020-02-13 04:24
Well... I don't know what your pipeline is.

bethskurrie
2020-02-13 04:24
I don't know what you're trying to achieve.

bethskurrie
2020-02-13 04:25
what would your process be for a PR branch normally?

bheemreddy181
2020-02-13 04:26
usually, my PR checks goes this way "unit test, pact tests, dB lints " with in my pact tests it will ? run tests , create contract , publish contract ? this is what I expected with all webhooks in place

bethskurrie
2020-02-13 04:27
It doesn't look like you need to wait for anything then.

bheemreddy181
2020-02-13 04:28
Ohk I gave a try but failed , I will try this once more then

sagupta
2020-02-13 13:54
I am getting {*PactBroker::Client::Error - Authentication failed*} when i try to publish pact json to the pact broker using my account credentials. when i use the username and password for ?https://test.pact.dius.com.au?? and it works fine . Can anyone tell me what i might be doing wrong here?

adrian.deanda
2020-02-13 16:08
has joined #pact-broker

bernardoguerr
2020-02-13 16:15
You may want to protect your credentials a bit better, that's still quite readable. Are you using Pactflow? Otherwise I think you don't need pactBrokerToken. Either way, I don't think you need to include Bearer there

bernardoguerr
2020-02-13 16:16
so you just need: pactBrokerToken: 'YOUR_TOKEN_HERE'

me1015
2020-02-13 17:03
has joined #pact-broker

sagupta
2020-02-13 17:37
I am using pactflow yes. I tried without using Bearer but I get same error .I am able to log in to Pactflow using the same credentials via ui.

pact501
2020-02-14 00:03
has joined #pact-broker

reverse9
2020-02-16 18:45
has joined #pact-broker

bernardoguerr
2020-02-16 19:01
I still see BEARER written on the token

bernardoguerr
2020-02-16 19:01
it should be `pactBrokerToken: 'YOUR_TOKEN_HERE'`

bernardoguerr
2020-02-16 19:01
No need to write down BEARER before

bethskurrie
2020-02-16 22:15
Also, @sagupta make sure you have the very latest pact-js. The token support has only been added recently.

baquinteros
2020-02-17 01:21
has joined #pact-broker

sagupta
2020-02-17 09:32
@bethskurrie Do you mean pact version , I am using 9.6.1 version pact . Is it the latest version?

sagupta
2020-02-17 09:34
Also I am not adding BEARER in token and still getting ?Authentication failed? error

bethskurrie
2020-02-17 09:43
I'm not the maintainer of pact-js, so I don't know what the latest version is. Have a look at the npm site, or the package.json in the pact-js github repository.

bethskurrie
2020-02-17 09:44
99% of pactflow authentication failures are due to old versions of pact-js though

sagupta
2020-02-17 09:49
I checked the version at the npm site and I am using the latest version of pact. Will ask this question in pact js channel then

bethskurrie
2020-02-17 09:50
@sagupta I'll check the logs when I can get to a computer.

sagupta
2020-02-17 09:51
ok sure

bethskurrie
2020-02-17 09:51
Can you PM me your Pactflow subdomain please.

bethskurrie
2020-02-17 09:52
@matt.fellows may be able to check for you before I can. (it's 9pm Australia time!)

matt.fellows
2020-02-17 11:35
@sagupta you have specified the username/password and token. You can?t use both modes of authentication at the same time. If you?re using Pactflow, just use the token

sagupta
2020-02-17 12:24
Hi Matt, yes indeed that was the problem. I didnt know that and Beth helped me with it. Its working now :slightly_smiling_face:

bheemreddy181
2020-02-19 00:51
Do we need a Stub Server and Mock Service along with pact broker setup internally ?

bethskurrie
2020-02-19 00:51
Those things are unrelated to each other.

bethskurrie
2020-02-19 00:52
The Pact Broker is a long lived service that runs all the time.

bethskurrie
2020-02-19 00:52
Mock and stub services just run for the duration of the test on the machine that that tests are running on.

bheemreddy181
2020-02-19 00:53
That makes complete sense

bheemreddy181
2020-02-19 00:57
Given if your services are containerised ? Do we see any value of just running these without your services being containerised

bethskurrie
2020-02-19 00:58
When you say containerised, do you mean, running your pact tests within a docker container, or, running the pact tests on a dockerized version of your application?

bheemreddy181
2020-02-19 00:59
Running pact tests on a dockerized version of my application

bethskurrie
2020-02-19 02:30
I'm assuming you're talking about the verification step, and not the consumer tests here?

bethskurrie
2020-02-19 02:30
You can do pact verification on a dockerised service, but it may make it more difficult to stub parts of your application.

bethskurrie
2020-02-19 02:31
Also, if you have a dockerised app, it suggests you've already got to the "packaging" step of your build, to get the earliest feedback possible, you want to run your pact tests as close to your "unit" (isolated) tests as possible.

bethskurrie
2020-02-19 02:32
you'd genererally go "isolated tests" (eg the ones that just run on your local dev machine), pact tests, package, can-i-deploy to test, deploy to test, can-i-deploy to prod, deploy to prod.

mail961
2020-02-19 07:48
has joined #pact-broker

shilpa3006
2020-02-19 19:12
@matt.fellows Hi Matt, I am not seeing last verified column updated even though verification is passing or successful. Any idea why?

shilpa3006
2020-02-19 19:14
@bethskurrie can you give some insights on this?

matt.fellows
2020-02-19 21:03
Have a look at the matrix. It's possible you've verified a version that's different than latest or haven't published a result. Can you please share as much detail so we can help. E.g. output of can I deploy, matrix view etx

shilpa3006
2020-02-19 21:57
@matt.fellows in matrix, I see provider version and pact verified as empty

shilpa3006
2020-02-19 22:01
What is the command to execute can I deploy?

shilpa3006
2020-02-19 23:09
@bheemreddy181 I thought when we run provider verification - .verify will take care of verification of pact file published on pact broker...I see webhook status as create but provider version and last verified is showing empty..I am sure I am missing some connecting part here. Where should I run can I deploy?

shilpa3006
2020-02-19 23:10
@matt.fellows I feel I am almost there but still feel I am no where near. Can you pls help Matt?

shilpa3006
2020-02-19 23:16
I have executed command- bundle exec rack up -p 8080 this initiated pact broker at local host 8080 and then I published consumer pact..now I run my provider verification- verification passes but I don?t see last verification updated in broker

bheemreddy181
2020-02-19 23:19
You have to set publish verification results as part of your rake task


shilpa3006
2020-02-19 23:20
Ah ok I have missed this part then

bethskurrie
2020-02-20 00:11
I'd say that your results are not being published @shilpa3006

bethskurrie
2020-02-20 00:11
Have you turned the publish flag on?

shilpa3006
2020-02-20 02:28
Nope

shilpa3006
2020-02-20 02:28
Figuring out where to turn it on

bethskurrie
2020-02-20 02:34
It's very easy and well documented for everything except pact JVM.

bethskurrie
2020-02-20 02:34
For some reason, it's tricky to turn on for JVM!

shilpa3006
2020-02-20 02:42
I am using pact net

bethskurrie
2020-02-20 02:44
Easy


matt.fellows
2020-02-20 06:46
Can I ask, if you weren't looking for the option on GitHub where were you? Do we need to update docs somewhere else?

agarwalatrisha1212
2020-02-22 17:02
hi all , i am unable to set up pact broker

agarwalatrisha1212
2020-02-22 17:03
I have installed prost gres and started locally but unable to set up connection

agarwalatrisha1212
2020-02-22 17:04
will appreciate your suggestion

agarwalatrisha1212
2020-02-22 17:04
:pray::pray::pray:

bheemreddy181
2020-02-23 16:10
you are using a docker image?

agarwalatrisha1212
2020-02-23 17:06
@bheemreddy181: yes, i tried with local and free tier already


agarwalatrisha1212
2020-02-23 17:56
Thank you @bheemreddy181 :pray:

bethskurrie
2020-02-23 21:26
@agarwalatrisha1212 did you work this out?

agarwalatrisha1212
2020-02-23 21:27
thank you @bethskurrie, i looking all suggestion shared in @bheemreddy181 thread

bethskurrie
2020-02-23 21:28
I'll take that as a yes then!

agarwalatrisha1212
2020-02-23 21:29
okay ! i will ask question it is not working out for me ! Thank you for asking !

dan.garland
2020-02-25 10:24
has joined #pact-broker

naamam
2020-02-25 15:03
has joined #pact-broker

ckkinay
2020-02-26 09:35
has joined #pact-broker

tomas.sakinis611
2020-02-26 20:33
has joined #pact-broker

nils.thenhausen
2020-02-27 18:52
has joined #pact-broker

pkuang
2020-02-27 21:30
Hi, Is it possible/does it make sense to provide a way to create a webhook for a provider that does not yet exists within the broker? We want to setup a provider project with Pact testing and set up a verification job to be triggered when a consumer contract is published referencing that provider via a webhook. Currently it fails with "pacticipant" not found. Does this mean we we have to wait for the consumer side to set up Pact testing first and publish the initial contract?

bethskurrie
2020-02-27 21:30
Make the pacticipant first using the API

bethskurrie
2020-02-27 21:31
POST /pacticipants {name: "foo"}

bethskurrie
2020-02-27 21:31
But also, you don't want to specify the consumer name

bethskurrie
2020-02-27 21:31
you want the webhook to fire for any consumer

bethskurrie
2020-02-27 21:31
So, just set the provider name.

bethskurrie
2020-02-27 21:31
Does that make sense?

pkuang
2020-02-27 21:32
ah ok thanks @bethskurrie! I wasn't aware you can explicitly create pacticipants outside of publishing a contract to create them

paulg4321
2020-02-27 23:12
has joined #pact-broker

amitojduggal
2020-02-29 13:57
Hello :slightly_smiling_face: , do we have an option to download all the pacts from the pact broker, and use all of those as mocks with pact-stub-server? or its something we have to write a script for?

matt.fellows
2020-02-29 20:07
When you say download all pacts, do you mean "download all pacts for a particular consumer with a particular tag?"

amitojduggal
2020-02-29 20:58
Okay let me be more specific, ?download pacts for all consumers with one particular tag? :slightly_smiling_face:

matt.fellows
2020-02-29 21:15
Out of interest, why would you want it for _all_ consumers at the same time?

matt.fellows
2020-02-29 21:16
Usually, when you stub something out, you?re stubbing out a single consumer (e.g. to do UI tests or something)

matt.fellows
2020-02-29 21:16
just interested in understanding the use case

matt.fellows
2020-02-29 21:17
In any case, it?s not currently supported. Feel free to raise an issue or submit a PR!

amitojduggal
2020-02-29 22:47
Thank you :slightly_smiling_face: the only reason to do this is , i was planning if we could fetch all pacts, put those in as part of a docker container. and use it with TestContainers to write integration tests against other services. If we fetch all of pacts, we dont have to create docker containers catering to each and every microservice. i will take a look, raise a issue and possible create a PR.

bethskurrie
2020-02-29 22:53
@amitojduggal if you look at the index resource in the API browser you'll find a list of all the endpoints you can hit.

bethskurrie
2020-02-29 22:54
You'll be able to achieve what you want, but you'll need to write a script for it.

bethskurrie
2020-02-29 22:55
It looks like you're trying to build a general purpose stub.

bethskurrie
2020-02-29 22:56
Be careful that you only stub with successfully verified pacts, otherwise, you could be stubbing with an invalid contract.

amitojduggal
2020-03-01 12:26
Thanks Beth, and Matt.

joel.whalen
2020-03-02 17:19
has joined #pact-broker

hendrik
2020-03-03 21:53
has joined #pact-broker

osirisnos4a2
2020-03-03 23:50
has joined #pact-broker

adam.strickland
2020-03-04 17:03
has joined #pact-broker

paulolai
2020-03-04 23:21
has joined #pact-broker

franklin.huynh
2020-03-05 00:49
hi @bethskurrie and @matt.fellows I think I may have an issue with our PactFlow instance. Could you please let me know where should I contact for support?

bethskurrie
2020-03-05 00:49

franklin.huynh
2020-03-05 00:53
thanks @bethskurrie

bethskurrie
2020-03-05 03:20
@franklin.huynh I can restore your db to 7am this morning, or you can keep what you have now. Which would be more useful?

franklin.huynh
2020-03-05 03:34
hi Beth, please keep what we have now. Thank you

tyler.rasor
2020-03-05 12:59
has joined #pact-broker

jarmy
2020-03-05 16:52
has joined #pact-broker

jarmy
2020-03-05 19:48
Hello. I?m following the ?Rolling your own? instructions here: https://github.com/pact-foundation/pact_broker/blob/master/README.md#rolling-your-own and had some questions around the database set up/wiring. I have an external Postgres DB already set up that I want to connect to. Do I need to include `gem "pg", "~>1.0"` in the Gemfile in order to connect to the remote DB or is it required for just installing the db? Let me give some context to the problem I faced. In order to deploy to our internal cloud, we need to use a base image built off of _debian:9.0_. This required me to migrate the Dockerfile from _alpine._ I then ran into a ruby versioning issue with _bundle install_ which led me to install and compile ruby 2.6.5 onto the image https://github.com/docker-library/ruby/blob/82eecb7596c3cb466dd87d4b0350d189a330b925/2.6/stretch/slim/Dockerfile.

matt.fellows
2020-03-05 23:38
if your database is postgres, then that Gem is absolutely necessary (because it needs to be able to speak the Postgres dialect) - creating tables, issues queries etc.

matt.fellows
2020-03-05 23:38
Unless I?m confused about the question

bethskurrie
2020-03-06 09:50
Yes, you need the gem if your db is postgres.

bethskurrie
2020-03-06 09:50
I think 2.0+ is out though

bethskurrie
2020-03-06 09:52
You need that gem for the app to connect to the database, as well as to run the migrations.

sjdl
2020-03-06 11:27
has joined #pact-broker

sjdl
2020-03-06 12:12
:pensive: have this exact issue Are there any maintained/recent Openshift/Helm deployments? Hard to find a working example that isn't 2+ years old...difficult to get started when you've limited knowledge with docker/ruby.

jarmy
2020-03-06 15:53
Thanks for the responses. I?ve got the broker running.

slimak2387
2020-03-09 13:40
has joined #pact-broker

slimak2387
2020-03-09 13:50
Hello guys, I'm wondering what should I add to the `whitelist` to create a webhook sending Slack notification like on the example from https://docs.pact.io/pact_broker/advanced_topics/webhooks/template_lib. I can whitelist IP or hostname so probably ```https://hooks.slack.com/services/T(team_id_prefixed_with_T)/.*``` is not the correct answer. Can you point me needed hostname? Is the following good enough? ```http://hooks.slack.com```

matt.fellows
2020-03-09 20:02
What do the docs say? I don't think You don't need to whitelist it. All https is whitelisted by default from memory

bheemreddy181
2020-03-09 21:31
Quick pr on pact broker if one of you matt/beth can help me with this by giving some review comments https://github.com/pact-foundation/pact-broker-docker/pull/21

abhi358
2020-03-10 05:03
has joined #pact-broker

slimak2387
2020-03-10 08:44
I get the following error when try to send Slack notification

slimak2387
2020-03-10 08:45
I'll try with whitelisting `http://hooks.slack.com` and let you know if it helps.

matt.fellows
2020-03-10 09:32
Ok so if you have already set a whitelist, then slack must be added as per this rule

matt.fellows
2020-03-10 09:33
`http://hooks.slack.com` looks correct to me

ahsan_bhai
2020-03-10 16:59
has joined #pact-broker

ahsan_bhai
2020-03-10 17:05
I have noticed something weird with `can-i-deploy` command. Not sure if this is as designed. When I run the command with `--to` option set to `invalid-tag` the command returns successful with status code as 0. However, no table is printed. ```pact-broker can-i-deploy -a XXXXXX -b http://XXXXXX -e a81980d379c665071cf1668fa3bde9a22aeebf9d --to prod Computer says yes \o/ CONSUMER | C.VERSION | PROVIDER | P.VERSION | SUCCESS? ------------------|--------------------------------|-------------------|--------------------------------|--------- XXXXXXXXX | 6e37c21959bf66792d21b794353... | XXXXXXXXXXX | a81980d379c665071cf1668fa3b... | true can-i-deploy -a XXXXXX -b http://XXXXXX -e a81980d379c665071cf1668fa3bde9a22aeebf9d --to invalid-tag Computer says yes \o/ There are no missing dependencies``` In first command, the result is expected. However, in second command `invalid-tag` doesn't exist in pact-broker. However, in both cases `a81980d379c665071cf1668fa3bde9a22aeebf9d` is a valid version

bethskurrie
2020-03-10 19:33
It looks like you have a provider there.

bethskurrie
2020-03-10 19:33
You can deploy it where ever you like.

bethskurrie
2020-03-10 19:35
There's no table because there are no verifications with any application in "invalid-tag" environment, but also, there are no missing dependencies in that environment that would prevent you from deploying to it.

aaron
2020-03-10 21:01
has joined #pact-broker

slimak2387
2020-03-11 15:18
Whitelisting `http://hooks.slack.com` solves the issue. Thank you for colaboration :right-facing_fist::left-facing_fist:

bethskurrie
2020-03-11 21:32
Does that make sense @ahsan_bhai?

greg719
2020-03-12 00:27
has joined #pact-broker

unitsix
2020-03-12 23:48
has joined #pact-broker

bradyzp
2020-03-13 21:39
has joined #pact-broker

tausif2909
2020-03-17 11:06
has joined #pact-broker

pkuang
2020-03-17 14:54
Hi, how do I configure the pact broker to log to stdout instead of a log file?

tjones
2020-03-18 03:44
I don?t know if there?s an easy way to configure this (the broker isn?t my area), but I?d start here: https://github.com/pact-foundation/pact-broker-docker/blob/master/pact_broker/logger.rb

arho.huttunen
2020-03-18 19:00
has joined #pact-broker

bethskurrie
2020-03-18 21:13
You must be rolling your own @pkuang because the docker version logs to stdout by default.

bethskurrie
2020-03-18 21:13
Yes, you can copy the way the docker one does it.

pkuang
2020-03-19 15:36
Thanks @tjones @bethskurrie

thakkarjinal29
2020-03-20 08:12
Is it possible to use `can-i-deploy` with verification result url from pact broker? Does that even make sense? My use-case is to check if particular versions of consumer and provider are compatible! Thanks

bethskurrie
2020-03-20 08:13
That's exactly what can-i-deploy does.

bethskurrie
2020-03-20 08:13
can-i-deploy --pacticipant Foo --version 1 --pacticipant Bar --version 2


thakkarjinal29
2020-03-20 08:16
Thanks! And I should be using the webhook to tell the provider CI what the consumer name and version is?

bethskurrie
2020-03-20 08:17
Can you describe how those two relate to each other?

bethskurrie
2020-03-20 08:17
Which webhook? pact changed, or verification published?

bethskurrie
2020-03-20 08:18
What are you trying to achieve by running can-i-deploy? It sounds like you have a non standard use case.

thakkarjinal29
2020-03-20 09:09
So the way I was thinking of going about this is: 1. Run consumer tests, publish the pact 2. If the contract content changed, trigger the webhook, to run the provider ci (circle ci job) 3. Publish the validation result 4. Use can-i-deploy to make sure the provider and consumer are compatible. However, I realize now the 4th step does not make very much sense, does it? I think I am mostly deciding what or where the right way to use can-i-deploy should be. Should it be when you run your ci? or during the deployment?

bethskurrie
2020-03-20 09:09
No, that's exactly right

bethskurrie
2020-03-20 09:10
But you've missed the thing that makes the can-i-deploy easy, and that's the tagging



bethskurrie
2020-03-20 09:11
If you don't use tags, you have to somehow work out which version of the other application you need to put in to the command

thakkarjinal29
2020-03-20 09:11
Yep, I did tag both the consumer and provider, however, what I am confused is, how would the provider ci know the tag of the consumer, unless both have the same tags?

bethskurrie
2020-03-20 09:12
tag with the name of the environment

bethskurrie
2020-03-20 09:12
when you deploy to it

bethskurrie
2020-03-20 09:12
have you read those docs?

bethskurrie
2020-03-20 09:12
yes, they should use the same tags (eg. test, prod)

bethskurrie
2020-03-20 09:12
you need to agree on your environment names

thakkarjinal29
2020-03-20 09:21
These are super helpful! Thanks! One last question! In what case, would tagging a pacticipant with it?s branch be helpful?

bethskurrie
2020-03-20 09:27
yes

bethskurrie
2020-03-20 09:28
rule of thumb @thakkarjinal29 - tag with the branch name when you publish pact/verification, tag with the environment name when you deply. With these done, you'll be prepared for anything.

thakkarjinal29
2020-03-20 09:29
Got it! Thanks!

bernardoguerr
2020-03-20 14:06
even for a global pandemic? :smile:

bheemreddy181
2020-03-20 16:00
Quick Question on Github publish commit status https://github.com/pact-foundation/pact_broker/wiki/Webhook-template-library#github---publish-commit-status - does this report back to the publish task ?

bethskurrie
2020-03-21 01:25
@bheemreddy181 report what back to which publish task?

bethskurrie
2020-03-21 01:26
Almost anything @bernardoguerr

bheemreddy181
2020-03-21 01:41
I mean how can I setup this as required check on GITHUB commits , should there be something listening to this request coming from broker @bethskurrie ?

bethskurrie
2020-03-21 01:41
Github will be listening...

bethskurrie
2020-03-21 01:41
You'll have to look at the github docs to see how to make it a required check.

bheemreddy181
2020-03-21 01:46
By Default i expect a pending check - until the webhook result renders back something like below

bethskurrie
2020-03-21 01:47
You have to push the pending status when the pact is published.

bheemreddy181
2020-03-21 01:47
so that should be a different Hook again ?

bethskurrie
2020-03-21 01:48
no - the hook in the template should do it for you

bethskurrie
2020-03-21 01:48
just try it

bheemreddy181
2020-03-21 01:48
i tried it for some reason it doesn?t work

bethskurrie
2020-03-21 01:48
if the pact is pre-verified, then when it is published, it will publish a verified github status

bethskurrie
2020-03-21 01:48
if it is not verified, it will be pending

bethskurrie
2020-03-21 01:49
a webhook should trigger your provider build, and then when the verificaiton is published, it will update the status with the results of the verification

bethskurrie
2020-03-21 01:49
you have to be using the dynamic URL that was passed through from the webhook for this to work

bheemreddy181
2020-03-21 01:49
these are some logs what i see ```[2020-03-20T22:20:09Z] INFO: HTTP/1.1 POST https://git.sample.com/bvennapureddy/portfolio/statuses/6bc856e96c75a44a54c4b09e72bc75e411342ed2 [2020-03-20T22:20:09Z] INFO: accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3 [2020-03-20T22:20:09Z] INFO: accept: */* [2020-03-20T22:20:09Z] INFO: user-agent: Ruby [2020-03-20T22:20:09Z] INFO: content-type: application/json [2020-03-20T22:20:09Z] INFO: authorization: ********** [2020-03-20T22:20:09Z] INFO: host: http://git.enova.com [2020-03-20T22:20:09Z] INFO: content-length: 245 [2020-03-20T22:20:09Z] INFO: {"state":"success","description":"Pact Verification Tests","context":"pgs ","target_url":"http://pact-broker-poc.dev.com/pacts/provider/pgs/consumer/portfolio/pact-version/490e930bfc0cdf2e1abfc615d19bfb12f4a98fc2/verification-results/116"} [2020-03-20T22:20:09Z] INFO: For security purposes, the response details are not logged. To enable response logging, configure the webhook_host_whitelist property. See /doc/webhooks#whitelist for more information. [2020-03-20T22:20:09Z] INFO: Retrying webhook in 10 seconds [2020-03-20T22:20:19Z] INFO: HTTP/1.1 POST https://git.sample.com/bvennapureddy/portfolio/statuses/6bc856e96c75a44a54c4b09e72bc75e411342ed2 [2020-03-20T22:20:19Z] INFO: accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3 [2020-03-20T22:20:19Z] INFO: accept: */* [2020-03-20T22:20:19Z] INFO: user-agent: Ruby [2020-03-20T22:20:19Z] INFO: content-type: application/json [2020-03-20T22:20:19Z] INFO: authorization: ********** [2020-03-20T22:20:19Z] INFO: host: http://git.enova.com [2020-03-20T22:20:19Z] INFO: content-length: 245 [2020-03-20T22:20:19Z] INFO: {"state":"success","description":"Pact Verification Tests","context":"pgs ","target_url":"http://pact-broker-poc.dev.com/pacts/provider/pgs/consumer/portfolio/pact-version/490e930bfc0cdf2e1abfc615d19bfb12f4a98fc2/verification-results/116"} [2020-03-20T22:20:19Z] INFO: For security purposes, the response details are not logged. To enable response logging, configure the webhook_host_whitelist property. See /doc/webhooks#whitelist for more information. [2020-03-20T22:20:19Z] INFO: Retrying webhook in 60 seconds```

bethskurrie
2020-03-21 01:50
Is that a real URL?

bheemreddy181
2020-03-21 01:50
I am using pact_broker,pact_url as part of my provider verification


bheemreddy181
2020-03-21 01:50
i modified the company while putting the logs here

bheemreddy181
2020-03-21 01:51
i mean the domain name just for security purpose

bethskurrie
2020-03-21 01:51
well, you'll need ot look at the logs

bethskurrie
2020-03-21 01:51
There was obviously an error.

bethskurrie
2020-03-21 01:51
I'm afraid I do not magically know what that error is.

bethskurrie
2020-03-21 01:51
`[2020-03-20T22:20:19Z] INFO: Retrying webhook in 60 seconds`

bheemreddy181
2020-03-21 01:51
logs on the broker ? or git itself while listening ?

bethskurrie
2020-03-21 01:52
read the text you just pasted to me

bethskurrie
2020-03-21 01:52
read every word

bethskurrie
2020-03-21 01:52
`[2020-03-20T22:20:19Z] INFO: For security purposes, the response details are not logged. To enable response logging, configure the webhook_host_whitelist property. See /doc/webhooks#whitelist for more information.`

bethskurrie
2020-03-21 01:52
This is frustrating me because it is written right there want you need to do.

bethskurrie
2020-03-21 01:53
And you've pasted the text to me without having read it, and you're asking me for help.

bheemreddy181
2020-03-21 01:53
it was already whitelisted using http://config.ru

bethskurrie
2020-03-21 01:54
Can I suggest you solve that problem first.

bheemreddy181
2020-03-21 01:54
well i read that i assumed that there is whitelisting issue but i don?t see that as an issue because i was able to ping the git ip from the node

bethskurrie
2020-03-21 01:54
And from memory, you were using the wrong format for your whitelist, last time we discussed this. You were trying to use the Ruby format for an environment variable.

bethskurrie
2020-03-21 01:55
Please ask a developer for help.

bheemreddy181
2020-03-21 01:55
Sure :+1:

bethskurrie
2020-03-21 01:55
"INFO: For security purposes, the response details are not logged. To enable response logging, configure the webhook_host_whitelist property."

bethskurrie
2020-03-21 01:55
It didn't say there was a problem contacting the host.

bethskurrie
2020-03-21 01:55
There are many other things that can go wrong in a request.

bethskurrie
2020-03-21 01:56
Just because you can ping the git doesn't mean that your request is working.

bethskurrie
2020-03-21 01:56
Why would it say `INFO: Retrying webhook in 10 seconds` `INFO: Retrying webhook in 60 seconds` etc unless there was an error?

bheemreddy181
2020-03-21 01:57
i understand there is a problem let me investigate more then

bheemreddy181
2020-03-21 01:58
fyi i see these logs ```INFO: For security purposes, the response details are not logged. To enable response logging, configure the webhook_host_whitelist property. See /doc/webhooks#whitelist for more information.\n",``` even for successful requests

bethskurrie
2020-03-21 01:58
Yes.

bethskurrie
2020-03-21 01:58
Get your whitelist working!

bheemreddy181
2020-03-21 01:58
only `retrying` is something which explains there is an issue

bethskurrie
2020-03-21 01:59
Get your whitelist working!

bheemreddy181
2020-03-21 01:59
Sure will try my best thanks for the help Beth, Happy weekend :slightly_smiling_face:

carolyn.biggar
2020-03-21 14:23
Hello, is there a way to make the Pact broker show "not run" or similar if there's a runtime error rather than a test failure? We're using the junit5 library and the most recent pact broker, the main example is if a consumer adds in a new "given" without us having a matching state. The tests don't run, but the results get pushed to the broker and show as verified succesfully. Thanks for any advice!

carolyn.biggar
2020-03-21 14:23
Dependencies in the provider test code: ```dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" testImplementation "org.junit.jupiter:junit-jupiter-api:5.4.2" testImplementation "org.junit.jupiter:junit-jupiter-params:5.4.2" testImplementation "org.junit.jupiter:junit-jupiter-engine:5.4.2" testImplementation "org.assertj:assertj-core:3.11.1" testImplementation "au.com.dius:pact-jvm-provider-junit5_2.12:3.6.11"```

carolyn.biggar
2020-03-21 14:26
The test looks a bit like this

carolyn.biggar
2020-03-21 14:27
@thomas.shipley FYI

thomas.shipley
2020-03-21 14:27
has joined #pact-broker

borsuk.artem034
2020-03-21 18:04
Hello, have some issue with pact broker, for version take commit hash and send to pact broker, but pact broker save version with different lenth and we can't match versions

borsuk.artem034
2020-03-22 07:37
UPD: in db I have to versions

borsuk.artem034
2020-03-22 07:40
for sending pact I'm used pact-node, commit hash taken from bitbucket variable

bethskurrie
2020-03-22 07:54
Please raise a proper issue with steps to recreate. The broker does not change the version number in any way. It may display the short sha in the matrix however, in older versions. I can't remember.

bethskurrie
2020-03-22 07:55
Why are you using a mix of short and long?

bethskurrie
2020-03-22 07:57
If the tests show as a successful verification when there was a run time error @carolyn.biggar, that's an issue with pact JVM. Please raise an issue and provide an executable example to recreate the issue.

bethskurrie
2020-03-22 07:58
You can use the public broker.

bethskurrie
2020-03-22 07:58
Broker base URL: https://test.pact.dius.com.au username: dXfltyFMgNOFZAxr8io9wJ37iUpY42M password: O5AIZWxelWbLvqMd8PkAVycBJh2Psyg1

borsuk.artem034
2020-03-22 08:41
actually, i'm not using short version name, I'm just taking variable BITBUCKET_COMMIT https://confluence.atlassian.com/bitbucket/variables-in-pipelines-794502608.html and use it in bitbucket pipelines, then in pact broker UI and DB i see shot commit hash (7 symbols) for all services, and everything was good. But one new service for the first build send long hash, second run (without any code changes) send short hash

borsuk.artem034
2020-03-22 08:42
one big difference new consumer is using pact-node for publishing

carolyn.biggar
2020-03-22 08:47
Thanks - I?ll see what I can set up and take it to #pact-jvm-help

bethskurrie
2020-03-22 09:43
No code that I know of transforms the git sha

bethskurrie
2020-03-22 09:44
Pact node is not meant to be used directly btw.

bethskurrie
2020-03-22 09:45
You should use pact-js.

bethskurrie
2020-03-22 09:45
Pact node is just support for pact-js @borsuk.artem034

bethskurrie
2020-03-22 09:46
See if you can turn on verbose mode when publishing. You'll be able to see the http requests and responses.

bethskurrie
2020-03-22 09:47
Is this particular service both a consumer and a provider? You're not publishing a pact with a short sha and a verification with a long sha (or the other way around) are you?

bethskurrie
2020-03-22 09:47
That would cause there to be two versions in the database.

bethskurrie
2020-03-22 09:51
Pact node doesn't do anything to the sha. I just checked. https://pact-foundation.slack.com/archives/C9VBGLUM9/p1584870500073000

borsuk.artem034
2020-03-22 10:26
yep, you are right

borsuk.artem034
2020-03-22 10:26
thanks for checking

borsuk.artem034
2020-03-22 10:28
I found the problem, bitbucket build after commit do ```git reset --hard 1a08b6146a51``` manual build run do ```git checkout 1a08b6146a51187bdb9c8c077f0fd850fc92e619```

borsuk.artem034
2020-03-22 10:29
so it was the difference, big thank you one more time :slightly_smiling_face:

bethskurrie
2020-03-22 20:01
Good to know.

audun.halland
2020-03-23 00:26
has joined #pact-broker

audun.halland
2020-03-23 00:32
Hi, there?s two pacticipants in my broker and there used to be interactions between them, but after refactoring there are now 0 interactions there. This means the consumer no longer publishes a pact referencing this provider. However, that means the pacticipant pair does not get an updated version showing zero interactions between them in the broker. So now I have a ?stuck interactions?. Do I have to delete every single historical version between those pacticipants?

bethskurrie
2020-03-23 00:33
That would probably be easiest.

bethskurrie
2020-03-23 00:33
You can do it thorugh the UI though

bethskurrie
2020-03-23 00:33
It's pretty easy

bethskurrie
2020-03-23 00:34
Click on the "..." next to the integration on the index page.

bethskurrie
2020-03-23 00:34
If you can't see that, you'll need to either upgrade, or send the delete request through the HAL browser.

audun.halland
2020-03-23 00:46
Hmm thanks, I think the version is pretty old.. checking..

bethskurrie
2020-03-23 00:46
it's worth keeping up to date. I put out releases at least a few times a month.

bethskurrie
2020-03-23 00:47
there are some webhooks vulnerabilities in older versions.

bethskurrie
2020-03-23 00:48
also, as time has gone on, and the amount of data that is returned in the matrix queries has increased, I've had to optimise that query a few times to stop it grinding to a halt!

bethskurrie
2020-03-23 00:48
I've got a new optimisation coming out this week.

audun.halland
2020-03-23 00:50
Nice. I can?t find my current version. I just have a docker image hash, which I can?t find on docker hub :grimacing:

bethskurrie
2020-03-23 00:51
You'll be on the dius/pact-broker instead of the pactfoundation/pact-broker probably

audun.halland
2020-03-23 00:51
yes

bethskurrie
2020-03-23 00:51
also, the version is in the response headers.

bethskurrie
2020-03-23 00:51
just click on the hal browser icon, and you'll see it in the response

audun.halland
2020-03-23 00:51
ah. `x-pact-broker-version: 2.19.2`

audun.halland
2020-03-23 00:52
pretty ancient I guess

bethskurrie
2020-03-23 00:52
We're up to 2.51.0

bethskurrie
2020-03-23 00:52
It's all backwards compatible if you want to upgrade your docker image

audun.halland
2020-03-23 00:52
It?s always ?safe? to upgrade wrt the database schema?

bethskurrie
2020-03-23 00:52
yes

audun.halland
2020-03-23 00:53
Cool, I?ll get right to it


audun.halland
2020-03-23 01:02
FYI, the ??? doesn?t appear in firefox but does in chrome?

bethskurrie
2020-03-23 01:02
how bizarre.

bethskurrie
2020-03-23 01:03
It does in mine!

bethskurrie
2020-03-23 01:04
any errors in your console?

audun.halland
2020-03-23 01:10
no, my guess is some CSS caching issue after upgrading. It works now :slightly_smiling_face:

bethskurrie
2020-03-23 01:10
:thumbsup::skin-tone-3:

audun.halland
2020-03-23 01:12
Thanks, now I got them all deleted :smile:

adadache
2020-03-23 16:22
has joined #pact-broker

anja.kammer
2020-03-23 18:56
I am using the pact-broker image from Dockerhub. (https://hub.docker.com/r/pactfoundation/pact-broker) How do I prevent the loading of the example data? Thanks for your help!

bethskurrie
2020-03-24 01:32
You can just delete it @anja.kammer

bethskurrie
2020-03-24 01:32
It won't repopulate once it's got real data in there.

bheemreddy181
2020-03-24 02:29
Thanks a ton @bethskurrie I was able to successfully use the GIT webhooks for completing the loop ( typically branch verification ) I learnt a lot in this journey and as you said it was the whitelisting issue.

bheemreddy181
2020-03-24 02:39
Sorry for eating up all your time with all those questions, have a great day. Thanks again :)

bethskurrie
2020-03-24 09:17
@bheemreddy181 glad to hear you got there!

waquino
2020-03-24 12:47
has joined #pact-broker

aliihlail
2020-03-24 18:44
has joined #pact-broker

aliihlail
2020-03-24 18:45
im trying a simple pact verigicationTest as attached. but im getting an error java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:125) at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:108) at

mukheem
2020-03-24 22:08
has joined #pact-broker

bethskurrie
2020-03-25 00:31
@aliihlail ask in the #pact-jvm-help channel please.


deepakverma
2020-03-26 01:25
has joined #pact-broker

iamjillsanluis
2020-03-26 07:58
has joined #pact-broker

josue.boix
2020-03-26 09:11
has joined #pact-broker

bethskurrie
2020-03-26 09:58
Hey testers in this channel! I've done a big refactor of the auth code in the `pactfoundation/pact-broker` image, and I'd love to get someone to do a regression test on it for me before I release it. It is covered with automated tests, but you can never be too careful with authentication and authorization! I just want to make sure that all the basic auth credentials work as they did previously (and as documented in the README) with the little addition of the read only user being allowed to do a POST to the new `/pacts/provider/{PROVIDER}/for-verification` endpoint. The PR is here. https://github.com/pact-foundation/pact-broker-docker/pull/22 Reply to this chat if you're interested!

ahsan_bhai
2020-03-26 20:04
yes. thank you.

carolyn.biggar
2020-03-26 21:34
Hello again pact broker people - I'd like to set up a notification to slack if the broker receives a "verification failed" update. I'd like to target a different slack channel per pact (the consumers'; the provider is getting notification via different means (ci pipeline failure). I only want the notification to fire for a failure. Is this possible, can you point me to any examples? Thanks!




bethskurrie
2020-03-26 21:43
Make one per consumer. Don't specify the provider (so it matches all providers).


carolyn.biggar
2020-03-26 21:44
ah brill :thumbsup: thanks for the quick response

rbenbolton
2020-03-26 22:57
has joined #pact-broker

carolyn.biggar
2020-03-27 00:16
Thanks very much, I have this working now

bethskurrie
2020-03-27 00:17
great stuff

pkuang
2020-03-27 20:15
Hi, what is the intended purpose for pacticipant labels and how do I set them? I cannot find any documentation for this feature. I'm assuming they are to add some metadata to the pacticipant. I was wondering if this could support a workflow where I want to add a particular label "x" to a set of pacticipants and be able to query the broker to give me all pacticipant names that have label "x"?

bethskurrie
2020-03-29 20:50
@pkuang they don't really do anything at the moment.

bethskurrie
2020-03-29 20:51
They were intended to allow you to group services by different areas of the business. It's not an area that has received much interest, so I didn't continue down that path.

bethskurrie
2020-03-29 20:52
You can query pacticipants by label using the URL `/pacticipants/label/{label}` and that's about all.

adadache
2020-03-29 22:29
Hey! I am looking for help regarding pact-broker?s pending pacts feature. Here is the setup: ? Consumers publishing pacts from `pact-js` ? Provider pulling pact from broker using `pact-jvm-gradle` plugin What?s the next step?

bethskurrie
2020-03-29 22:29
Unfortunately, pact-jvm does not support the pending pacts feature yet.

bethskurrie
2020-03-29 22:30
Ron is working on it however.

bethskurrie
2020-03-29 22:30
Sorry, I did mention this in the other thread, but you must have missed that comment.

adadache
2020-03-29 22:31
Is there any suggestion for a workaround?

adadache
2020-03-29 22:31
Use a client or smth

bethskurrie
2020-03-29 22:31
Hm.

bethskurrie
2020-03-29 22:32
You could call the new API directly, and then run each pact verification separately, handling the exit code manually so that the tests don't fail the build when the pact is set to pending=true

bethskurrie
2020-03-29 22:34
This is the documentation for the new API


bethskurrie
2020-03-29 22:35
It relies on a new API being used to collect the list of pacts to verify. That API is documented here: https://github.com/pact-foundation/pact_broker/issues/307

matt.fellows
2020-03-29 22:36
Want to contribute the feature @adadache? :slightly_smiling_face:

adadache
2020-03-30 00:40
@bethskurrie and what about using the `pact-provider-verifier` instead? It seems that the above stuff supports pending pacts.

adadache
2020-03-30 00:41
@matt.fellows thank you, but I won?t have time for effective contribution

bethskurrie
2020-03-30 00:42
that's not a bad idea @matt.fellows

bethskurrie
2020-03-30 00:43
@adadache there is a standalone verifier process that you can use that supports the pending pacts feature. It's available as a CLI or a docker image https://github.com/pact-foundation/pact-provider-verifier

bethskurrie
2020-03-30 00:43
It only supports v2 pact specification, but if your consumers are javascript, then they're on v2 anyway

adadache
2020-03-30 00:44
Thanks! I?m on it.

bethskurrie
2020-03-30 00:44
You'll need to run it with ` ```--enable-pending```

bethskurrie
2020-03-30 00:45
You'll also need to run your pact broker with the environment variable `PACT_BROKER_FEATURES=pacts_for_verification`

bethskurrie
2020-03-30 00:46
There's a little script for playing around with the new API here https://github.com/pact-foundation/pact-provider-verifier/blob/master/script/dev/broker.sh

godfrey.carnegie
2020-03-30 10:34
has joined #pact-broker

pkuang
2020-03-30 14:10
thanks @bethskurrie

ina.lopez
2020-03-30 21:28
has joined #pact-broker

adadache
2020-03-31 17:17
This ends up in Gradle, seriously. @bethskurrie I?ve got working pendings and verifications are published! yaaay

adadache
2020-03-31 17:19
Eventually, what saves the day is your `--enable-pending` through the dockerized cli! You?ve just made our blog post much more longer :confused:

matt.fellows
2020-03-31 21:13
Awesome! Looking forward to the blog.

bethskurrie
2020-03-31 21:14
Sweet.

bethskurrie
2020-03-31 21:17
BTW, I appreciate that you got the self signed certificate working without raising any issues!

matt.fellows
2020-03-31 21:17
:stuck_out_tongue:

adadache
2020-03-31 21:22
Thank you @matt.fellows and @bethskurrie!

bethskurrie
2020-03-31 21:23
Did you have much time doing the verifications before you used the pending feature? I'd be interested to hear how it has affected your experience with Pact.

borsuk.artem034
2020-04-01 10:17
More info for future, inside bitbucket pipelinse when you specify action for ```pull-requests: '**': - step: .....``` bitbucket take first 11 symbols commit hash for anothed action take long commit hash and as result your verication can fails, for non version counsumer/provider

simon.nizov
2020-04-01 12:57
has joined #pact-broker

simon.nizov
2020-04-01 13:02
Hi! My pactman-powered provider verification passes, but the verification result in the broker appears as failed. Is there a way to get the verification result endpoint in the broker to display the details of the failure?

antonello
2020-04-01 14:30
I wonder if perhaps not all interactions of your pact are verified by your provider verification tests.

bethskurrie
2020-04-01 19:17
What would you want the broker to be able to do to support that? @borsuk.artem034?

bethskurrie
2020-04-01 19:20
Simon, pactman doesn't send the test level results to the pact broker, as far as I know. It's now unsupported, as the author has changed companies and isn't using pact any more.

sacharya_pact
2020-04-02 05:38
has joined #pact-broker

lbraymusso
2020-04-02 05:39
has joined #pact-broker

borsuk.artem034
2020-04-02 06:38
actually it's bitbucket problem (bitbucket agent have different behavior for 'pull-request' stage). for pact broker, we can do some matching, but I think its very bad idea, other people will have many problems

simon.nizov
2020-04-02 06:41
I remember when he announced his departure he introduced the person who will be taking over the project. Or am I mistaken? Also, there?s a commit in the project a month and a half ago :thinking_face:

bethskurrie
2020-04-02 07:36
We haven't found any official yet. Elliot Murray has done some work on pact-python, but he may or may not get around to having a look at pactman.

simon.nizov
2020-04-02 07:40
So it?s a safer bet to go with `pact-python` right now?

bethskurrie
2020-04-02 07:40
Yes. It uses the shared ruby impl under the hood, so we can easily update it with new features.


adadache
2020-04-02 08:19
@bethskurrie we did not have time with the standard workflow. We needed pending pacts immediately, as the guys are working async, but into a monorepo.

adadache
2020-04-02 08:20
We have an ?affected? pipeline which only executes the java verification once the backend is affected, the same applies on frontend applications (we have multiple clients)

adadache
2020-04-02 08:20
The Pact sits on the top of it

adadache
2020-04-02 08:21
Runs in nightly builds, and prepared for local development too, as we are using tags and app versions for each publish/verification

bethskurrie
2020-04-02 08:35
Hm, that's annoying. The only thing I can think of is to consistently use 11 characters everywhere.

simon.nizov
2020-04-02 17:07
Ok.. too bad, I like `pactman`'s `pytest`-powered provider verification. Let me know if guys are planning anything similar, or other improvements to `pact-python`, I might be able to help out.

waquino
2020-04-02 20:50
Hi! :slightly_smiling_face: i?m trying to implement the contract testing in my organization, at this point we are evaluating if we should host our own pact broker or just use the pact flow. could any of you guys share your experience or recommendations?

ryan.dens
2020-04-02 20:54
My company went with pactflow based on a cost/benefit mainly considering developer maintenance. Can?t recommend it enough :slightly_smiling_face:

bethskurrie
2020-04-02 20:54
Hi @waquino I'm a little biased, but here is a list of features you get in Pactflow that you don't get in the OSS product https://pactflow.io/oss/ We're investigating adding things like metrics and OAS contract testing support in the future.

bethskurrie
2020-04-02 20:54
Thanks @ryan.dens!

waquino
2020-04-02 21:13
thanks, let me try see :slightly_smiling_face:

waquino
2020-04-02 21:15
yes, that is my main concern

antonello
2020-04-03 06:31
I don?t think the broker has an endpoint to check verification of individual states or interaction, does it?

bethskurrie
2020-04-03 07:17
@antonello if the client supports it, interaction level results are published to the broker. But pactman does not support that, to my knowledge.

bethskurrie
2020-04-03 07:18
Any of the languages that wrap the standalone, and the rust, and I think pact-jvm do.

antonello
2020-04-03 07:18
It?s pact-jvm. But yes, it was a stupid question because I knew already that it wouldn?t publish that.

bethskurrie
2020-04-03 07:19
Ah, right.

bethskurrie
2020-04-03 07:20
There will be a bit of code that does the calculation in pact-jvm - maybe you can put a breakpoint there?

bethskurrie
2020-04-03 07:20
Or, it might just count the number.

bethskurrie
2020-04-03 07:31
@simon.nizov the end goal is for a python implementation that calls out to a shared rust library, from the native python code (so it can be used with pytest).

bethskurrie
2020-04-03 07:31
We might make pactman the base for that - we'll see how it goes when we come to pick up that work.

simon.nizov
2020-04-03 07:41
Sounds good. Where can I follow the progress of the rust implementation? Is it this one - https://github.com/pact-foundation/pact-reference/ ?

bethskurrie
2020-04-03 07:42
The underling rust impl is done, but the work to make all the code nicely available for other languages and at the right level of abstraction is I think still in progress.

bethskurrie
2020-04-03 07:43
@matt.fellows and @uglyog are working on the pact-js/rust implementation first.

bethskurrie
2020-04-03 07:43
Probably following that work will give you the best idea of where things are at.

bethskurrie
2020-04-03 07:43
I'll make an feature request in canny though


simon.nizov
2020-04-03 07:45
Thanks, voted up

simon.nizov
2020-04-03 07:46
Is the roadmap section up to date?

bethskurrie
2020-04-03 07:46
where?


bethskurrie
2020-04-03 07:48
It's dynamic, so yes.

simon.nizov
2020-04-03 07:48
:thumbsup:

bwoodhouse322
2020-04-03 15:23
has joined #pact-broker

ina.lopez
2020-04-05 04:42
I downloaded pact-broker from https://github.com/pact-foundation/pact_broker/tree/master/example And started it: ```bundle exec rackup``` I am getting: ```scheme must be https. See /doc/webhooks#whitelist for more information.``` Is there a way to enable HTTP for my webhooks? I am having a lot of problems enabling https locally for my jenkins

bethskurrie
2020-04-05 04:52
did you look at the URL that it said to look at?


ina.lopez
2020-04-05 04:53
lol you sound like me half of the times :slightly_smiling_face:

ina.lopez
2020-04-05 04:53
yes

bethskurrie
2020-04-05 04:53
were the instructions not clear?

ina.lopez
2020-04-05 04:53
found it: config.webhook_scheme_whitelist = ['http']

bethskurrie
2020-04-05 04:53
:thumbsup::skin-tone-3:

ina.lopez
2020-04-07 17:10
Should I create webhooks for `contract_content_changed` and `contract_published`? If so, broker knows when to run which one? And both of these webhooks call the same job: Provider CI verify "${pactbroker.pactUrl}"?

audun.halland
2020-04-07 17:26
@audun.halland has left the channel

rbenbolton
2020-04-07 21:25
Hey everyone, I?m trying to set up a pact broker locally and instead of using local postgres, as I?ve done in the past, I thought of trying it with the postgres container. I?m trying to run the first command as outlined in the `pact-broker-docker` POSTGRESQL.md for setting up postgresql: ```docker run --name pactbroker-db -e POSTGRES_PASSWORD=ThePostgresPassword -e POSTGRES_USER=admin -e PGDATA=/var/lib/postgresql/data/pgdata -v /var/lib/postgresql/data:/var/lib/postgresql/data -d postgres``` but I keep getting the following error: ```docker: Error response from daemon: Mounts denied: The path /var/lib/postgresql/data is not shared from OS X and is not known to Docker. You can configure shared paths from Docker -> Preferences... -> File Sharing. See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.``` I created the dir `/var/lib/postgresql/data` and enabled file sharing in Docker for Mac which adds it as `/private/var/lib/postgresql/data` and re-ran the `docker run` command, but still get the same error. Thoughts?

rbenbolton
2020-04-07 22:38
This question may no longer need to be addressed. Using `docker-compose` pulls down the image for me and sets it up for the broker service. Still curious about the above, but no longer blocking me.

bethskurrie
2020-04-07 22:39
I think this is a question for a docker forum @rbenbolton.

rbenbolton
2020-04-07 22:39
Ok, sounds good. Thanks.

bethskurrie
2020-04-07 22:39
@ina.lopez it depends what you want to do with the webhook.

bethskurrie
2020-04-07 22:39
If you want to run a verification, then just trigger on the contract_content_changed.


bethskurrie
2020-04-07 22:40
Here's an example


bethskurrie
2020-04-07 22:41
You can have as many webhooks as you want, and all the webhooks that match will get fired.

ina.lopez
2020-04-07 23:32
contract-content-changed wouldn't trigger the very first time, correct? I created contract_created also

bethskurrie
2020-04-08 00:14
pretty sure it fires on the first creation


siddharth.gupta
2020-04-08 07:26
has joined #pact-broker

siddharth.gupta
2020-04-08 07:40
Hi there , I am beginner with Pact , I have been able to run consumer and provider tests provided at https://github.com/pact-foundation/pact-net. But I have question for the experts , when we test the provider APIs which interacts with an external component for example a SQL db , how do we deal with such scenario when running contract tests on local developer machine . As we do not deploy the services instead use self hosted routing .

anguyen0815
2020-04-08 15:44
has joined #pact-broker

kjtester
2020-04-10 09:30
has joined #pact-broker

rahulpandey8920
2020-04-13 21:28
has joined #pact-broker

rahulpandey8920
2020-04-13 21:37
Hi Siddharth, I am also a beginner with Pact and came across this interesting article: https://www.infoq.com/articles/microservices-consumer-driven-contracts-pact-docker/ Where Harry Winser from Rightmove has written about how they are using stubs for any external dependencies of the provider. > _This ?stub? is used instead of the production artefact throughout the CDC testing, as the artifact doesn?t require data sources or upstream dependencies; they?ve been stubbed out._

rahulpandey8920
2020-04-14 10:00
Is there an official helm chart for PactBroker ? I think this question has been asked before but I am not able to access the conversation history.

matt.fellows
2020-04-14 10:01
It has been asked. Someone had published one but we haven't officially endorsed it or anything

rahulpandey8920
2020-04-14 10:07
Thank you for your response. Is there a plan to publish an official helm chart for this in the roadmap ?

matt.fellows
2020-04-14 10:10
No, and Not that I'm aware. We'd accept it into the foundation of the community supported it and gave it a vote if confidence

bethskurrie
2020-04-14 10:11
Because we have the free version of slack, the answer has dropped out of our storage space.

bethskurrie
2020-04-14 10:11
But Google shows a few results.

rahulpandey8920
2020-04-14 10:12
Thanks.

matt.fellows
2020-04-14 10:41
Oh. I just realised I had a spelling error before. I meant 'np' to answering your q! ( On mobile)

paras.vora1801
2020-04-14 11:34
has joined #pact-broker

paras.vora1801
2020-04-14 11:36
@bethskurrie I am trying to install the *pact-broker-docker* on my Mac OS, using command `docker run --name pactbroker-db -e POSTGRES_PASSWORD=root -e POSTGRES_USER=admin -e PGDATA=/var/lib/postgresql/data/pgdata -v /var/lib/postgresql/data:/var/lib/postgresql/data -d postgres` however, I encounter below error: `docker: Error response from daemon: Mounts denied:`  `The path /var/lib/postgresql/data` `is not shared from OS X and is not known to Docker.` `You can configure shared paths from Docker -> Preferences... -> File Sharing.` `See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.`

paras.vora1801
2020-04-14 11:38
This is how the Docker File Sharing looks like.

matt.fellows
2020-04-14 11:39
So this is definitely a Docker issue or configuration problem

paras.vora1801
2020-04-14 11:39
Moreover, the folder `/var` & all inside, are having the 777 permissions

matt.fellows
2020-04-14 11:39
Is it really important that you use `/var/lib/postgresql/data/pgdata`on your host machine? Can you just bind to another path?

paras.vora1801
2020-04-14 11:40
`docker run --name pactbroker-db -e POSTGRES_PASSWORD=root -e POSTGRES_USER=admin -e PGDATA=/private/var/lib/postgresql/data/pgdata -v /private/var/lib/postgresql/data:/private/var/lib/postgresql/data -d postgres`

paras.vora1801
2020-04-14 11:40
Pre-fixed `/private` before the `/var/lib/postgresql/data/pgdata`

matt.fellows
2020-04-14 11:41
Annoying that Docker doesn?t resolve the path, because it?s a symlink anyway. But good that you?ve found a way

paras.vora1801
2020-04-14 11:43
Now, post `docker run --name pactbroker-db -e POSTGRES_PASSWORD=root -e POSTGRES_USER=admin -e PGDATA=/private/var/lib/postgresql/data/pgdata -v /private/var/lib/postgresql/data:/private/var/lib/postgresql/data -d postgres` a running container of the image is expected so that the procedure can be followed - `docker run -it --link pactbroker-db:postgres --rm postgres sh -c 'exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U admin'`

paras.vora1801
2020-04-14 11:43
However, it seems that the container starts & stops immediately.

matt.fellows
2020-04-14 11:44
what are you actually trying to do?

paras.vora1801
2020-04-14 11:45
Install pact-broker-docker

matt.fellows
2020-04-14 11:45
for testing purposes, or production?

matt.fellows
2020-04-14 11:46
Can you use docker compose?

paras.vora1801
2020-04-14 11:46
For now, testing purpose.

matt.fellows
2020-04-14 11:46
I would use the docker-compose image in the repository.

matt.fellows
2020-04-14 11:46
You don?t need to perform all of these linking and activities. It should just ?start up?

matt.fellows
2020-04-14 11:47
```version: "3" services: postgres: image: postgres healthcheck: test: psql postgres --command "select 1" -U postgres ports: - "5432:5432" environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: password POSTGRES_DB: postgres broker_app: image: dius/pact-broker links: - postgres ports: - 80:80 environment: PACT_BROKER_BASIC_AUTH_USERNAME: pact_workshop PACT_BROKER_BASIC_AUTH_PASSWORD: pact_workshop PACT_BROKER_DATABASE_USERNAME: postgres PACT_BROKER_DATABASE_PASSWORD: password PACT_BROKER_DATABASE_HOST: postgres PACT_BROKER_DATABASE_NAME: postgres```

matt.fellows
2020-04-14 11:47
`docker-compose up`

matt.fellows
2020-04-14 11:47
That will get you a running pact broker in just a few minutes

paras.vora1801
2020-04-14 11:48
any link to the procedure to setup using docker compose?

matt.fellows
2020-04-14 11:48
Procedure?

matt.fellows
2020-04-14 11:48
Have you used docker compose before?

paras.vora1801
2020-04-14 11:48
I mean steps.

paras.vora1801
2020-04-14 11:48
Not really.

matt.fellows
2020-04-14 11:48
k

matt.fellows
2020-04-14 11:48
Docs for docker compose: https://docs.docker.com/compose/

matt.fellows
2020-04-14 11:49
Step 1: Save the file above as `docker-compose.yml` Step 2: Run the command `docker-compose up` Step 3: ?wait a little? Step 4: head to `http://localhost` in your browser The credentials for access are `pact_workshop`/`pact_workshop` (customise as needed)

matt.fellows
2020-04-14 11:50
bam, done

paras.vora1801
2020-04-14 11:51
Thanks @matt.fellows, let me try.

paras.vora1801
2020-04-14 12:08
.

waquino
2020-04-16 02:29
Hi i wonder is is possible to migrate data from the OSS to the pactflow and the other way around?

matt.fellows
2020-04-16 02:30
Data can be migrated both ways, but from Pactflow -> OSS there are limitations (e.g. things like Secrets, webhook configurations etc. won?t translate due to some of the features absent in the OSS version)

bethskurrie
2020-04-16 02:31
We'd be able to help you export from your oss database (assuming it's also Postgres) and import it into a Pactflow tenant.

waquino
2020-04-16 12:50
i wonder both ways

waquino
2020-04-16 12:50
is there also a way to migrate my data from pactflow to OSS

waquino
2020-04-16 12:51
i need to present the proposal to my management

james.salamon
2020-04-16 16:01
has joined #pact-broker

bethskurrie
2020-04-17 09:47
I've run a script to iterate over the pacts and transfer them from one broker to another before.

bethskurrie
2020-04-17 09:48
It wasn't too difficult. You really only need the latest copies for the important tags.

darshan
2020-04-17 16:27
has joined #pact-broker

sgriffiths1975
2020-04-20 00:10
has joined #pact-broker

artur.ashyrov
2020-04-21 21:00
has joined #pact-broker

sabil.beladri
2020-04-21 21:19
has joined #pact-broker

dsmith
2020-04-23 06:59
has joined #pact-broker

corey
2020-04-23 15:17
has joined #pact-broker

shilpa3006
2020-04-24 00:40
Hi @bethskurrie I have created a web hook (linked bamboo build plan of provider)in pact broker. Ran consumer tests it created pact file and trying to run webhook...but we hook status shows Retrying

shilpa3006
2020-04-24 00:40
How can I debug this ?

shilpa3006
2020-04-24 00:40
My build plan did not kickoff


bethskurrie
2020-04-24 00:41
Are you using Pactflow or OSS Pact Broker?

shilpa3006
2020-04-24 00:43
I have installed pact broker gem (ruby) on local...not sure if it?s Pactflow or OSS Pact Broker

bethskurrie
2020-04-24 00:43
It's OSS.

shilpa3006
2020-04-24 00:43
Ok

bethskurrie
2020-04-24 00:43
```docker run --rm \ -e PACT_BROKER_BASE_URL \ pactfoundation/pact-cli:latest \ broker test-webhook \ --uuid ${WEBHOOK_UUID}```

bethskurrie
2020-04-24 00:44
The easiest way to test it is to run the test webhook command.

bethskurrie
2020-04-24 00:44
You'll need to get the UUID of the webhook through the HAL browser.

shilpa3006
2020-04-24 00:44
I am not using docker

bethskurrie
2020-04-24 00:44
not even on your local machine?

shilpa3006
2020-04-24 00:45
Yes it?s hosted in local

shilpa3006
2020-04-24 00:45
I can run locally

bethskurrie
2020-04-24 00:45
If you have docker locally, run that command


shilpa3006
2020-04-24 00:46
I am not using docker...so will the url

bethskurrie
2020-04-24 00:47
ignore the docker comments


bethskurrie
2020-04-24 00:47
Just do that.

shilpa3006
2020-04-24 00:50
Sure. I saw the error about whitelist

shilpa3006
2020-04-24 00:52
The response details are not logged. To enable a response logging, configure the webhook_host_whitelist property

bethskurrie
2020-04-24 00:52
Ok, so go and do that.

bethskurrie
2020-04-24 00:52
Follow the link it says to follow.

bethskurrie
2020-04-24 00:52
It's relative to your broker's base URL.

shilpa3006
2020-04-24 00:59
So, it says to update the config which I am assuming http://config.ru file

bethskurrie
2020-04-24 00:59
if you're running a vanilla, straight ruby app (no docker) then yes.

shilpa3006
2020-04-24 00:59
Ok


shilpa3006
2020-04-24 01:01
You are Awesome :blush:

shilpa3006
2020-04-24 01:02
Done.

shilpa3006
2020-04-24 01:03
Should I restart broker or do I need to change pact file in order to trigger again?

bethskurrie
2020-04-24 01:03
restart

shilpa3006
2020-04-24 01:05
Webhook did not get triggered now

bethskurrie
2020-04-24 01:05
probably because the pact hasn't changed.

bethskurrie
2020-04-24 01:06
Go and trigger it manually as per the instructions above.

shilpa3006
2020-04-24 01:25
Looks like I have created 2 webhooks..don?t see any delete icon

shilpa3006
2020-04-24 01:26
Got it

shilpa3006
2020-04-24 01:26
Have to send delete req

shilpa3006
2020-04-24 01:32
Now, Getting Authenticated_failed

shilpa3006
2020-04-24 01:33
Status code 404

matt.fellows
2020-04-24 01:52
authentication failed or a 404? They are two separate things

bethskurrie
2020-04-24 01:59
Is that the response from the webhook test request?

shilpa3006
2020-04-24 02:00
First 404 and then authenticed_failed

bethskurrie
2020-04-24 02:01
From which request? Please be quite specific.

bethskurrie
2020-04-24 02:01
If it's the request that the webhook is making, then it'll be your job to work out how to make the right request first. I'd recommend getting it working with curl first.

bethskurrie
2020-04-24 02:02
Then translate that into a webhook.


bethskurrie
2020-04-24 02:04
Are you familiar with curl? Or maybe postman?

shilpa3006
2020-04-24 02:04
Postman yes

bethskurrie
2020-04-24 02:04
Get the request working with postman.

shilpa3006
2020-04-24 02:04
I see

shilpa3006
2020-04-24 02:04
Sure

bethskurrie
2020-04-24 02:05
Pactflow has a UI for this that makes it much easier to debug.

shilpa3006
2020-04-24 02:06
Hmm not sure what the effort to migrate it to pactflow

bethskurrie
2020-04-24 02:06
Very little. It's a fork of the Pact Broker.

bethskurrie
2020-04-24 02:07
With extra goodies on top. So the api is exactly the same.

shilpa3006
2020-04-24 02:07
Ok

shilpa3006
2020-04-24 02:07
I can try

shilpa3006
2020-04-24 02:13
For now I am trying postman...not sure where to pass username and pass for bamboo?

shilpa3006
2020-04-24 02:13
It?s part of Params or headers?

shilpa3006
2020-04-24 02:14
Getting 401 unauthorized

bethskurrie
2020-04-24 02:14
I don't know - you'll need to read the bamboo documentation.

shilpa3006
2020-04-24 02:14
Ok

shilpa3006
2020-04-24 02:17
I figured it out but still 404 looks like my bamboo url is messed up

mbieganski.infomatt
2020-04-24 12:39
has joined #pact-broker

mbieganski.infomatt
2020-04-24 13:15
Hey everyone, I have read Pact Nirvana article :slightly_smiling_face: and now trying to setup Pact and Pact Broker with feature branches. If I understand correctly the idea is to have separate jobs to run tests triggered by web-hook on contract change and all providers pipelines from feature branches and master verify against stable master branch. Lets have a scenario where I don't have stable tag yet and no separate provider pipeline: 1. Push contract to feature branch with tag 2. Feature branch pipeline pass 3. Push provider to feature branch with pactbroker.tags=master 4. Latest feature branch is verified Does it mean that master branch will be preverified? First I have to merge provider to master and then consumer. If I would merge feature provider to master branch with can-i-deploy in pipeline against master consumer it would pass?

asher.feil
2020-04-24 16:15
has joined #pact-broker

bethskurrie
2020-04-24 22:36
Hi @mbieganski.infomatt there are a couple of things about your scenario that I don't understand.

bethskurrie
2020-04-24 22:37
In step 3, which tags are you talking about?The provider version tag, or the consumer?

bethskurrie
2020-04-24 22:38
If you have time to do this workshop, I think it will help you understand your scenario https://github.com/pactflow/ci-cd-workshop/

bethskurrie
2020-04-24 22:38
It's hot off the press and uses all the latest ci/cd workflow features.

bethskurrie
2020-04-24 22:39
> Does it mean that master branch will be preverified?

bethskurrie
2020-04-24 22:41
I'm not sure if you said you're tagging the provider's feature branch with `master` or whether you're verifying the `master` pacts, so it's hard to answer this question.

bethskurrie
2020-04-24 22:41
If you're tagging your provider version with `master` from a feature branch (which is not recommended!!!) then yes, the can-i-deploy query will think that the pact has been pre-verified by the `master` provider (which it hasn't).

bethskurrie
2020-04-24 22:44
The recommended usage would be to tag the provider version with the branch name, dynamically. That way, once the feature is implemented on the branch, the consumer gets the (correct) feedback that the code is done, but it's not yet merged. Then, once the provider feature branch has been merged, and they get a successful verification result from master, they know they're good to merge the consumer.

bethskurrie
2020-04-24 22:44
How these verification results get published is covered here: https://github.com/pactflow/ci-cd-workshop/blob/master/workshop/05_verifying_feature_pacts.md

praneethkumar
2020-04-27 10:31
has joined #pact-broker

praneethkumar
2020-04-27 10:33
Hi everyone, I am looking to install pact broker in our paas environment (open shift ). Is there any guide or document that can help ? I looked online but couldn?t find much info Thanks Praneeth

bethskurrie
2020-04-27 10:34
Yeah, there are some examples


praneethkumar
2020-04-27 10:36
Thank you so much

shilpa3006
2020-04-27 20:58
Hi Beth.. I have successfully created webhook on pact broker..whenever pact file gets changed, webhook will trigger and provider build gets kicked off for verification...I am clear on this but what happens when provider have changes and has to verify all consumer pacts? How or where should we configure that provider ci?

matt.fellows
2020-04-27 21:27
Look at the docs for provider verification in your language. There should be a configuration to pull pacts from a broker

shilpa3006
2020-04-27 21:37
@matt, I am aware of retrieving pacts for verification but my question was like configuring provider ci flow...like when provider commits changes to their api, in ci - it would trigger( in our case it?s bamboo)the verification of pacts- all this is independent of pact broker except getting pacts from broker right?

matt.fellows
2020-04-27 22:02
Yep



bethskurrie
2020-04-27 22:03
> When the provider changes, the pact verification task runs as part the provider's normal build pipeline, generally after the unit tests, and before any deployment takes place. This pact verification task is configured to dynamically fetch all the relevant pacts for the specified provider from Pactflow, verify them, and publish the results back to Pactflow. > To ensure that a verification is also run whenever a pact changes, we create a webhook in Pactflow that triggers a provider build, and passes in the URL of the changed pact. Ideally, this would be a completely separate build from your normal provider pipeline, and it should just verify the changed pact.

matt.fellows
2020-04-27 22:04
Did you update with the fixes from last week Beth?

bethskurrie
2020-04-27 22:04
Yes, I think so

bethskurrie
2020-04-27 22:05
builds are green

aliihlail
2020-04-27 22:12
``` @ActiveProfiles("test") @Provider("key-service") @Consumer("document-service") @PactBroker @IgnoreNoPactsToVerify public class DocumentVerificationTest { private static final Logger LOGGER = LoggerFactory.getLogger(DocumentVerificationTest.class); @TestTemplate @ExtendWith(PactVerificationInvocationContextProvider.class) void testTemplate(Pact pact, Interaction interaction, PactVerificationContext context) throws IOException { http://LOGGER.info("testTemplate called: " + pact.getProvider().getName() + ", " + interaction); context.verifyInteraction(); } @BeforeEach void setupTestTarget(PactVerificationContext context) throws IOException { context.setTarget(new AmpqTestTarget()); } ---------------------- <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>2.22.1</version> </plugin> <plugin> <groupId>http://au.com.dius</groupId> <artifactId>pact-jvm-provider-maven</artifactId> <version>4.0.10</version> <configuration> <serviceProviders> <serviceProvider> <name>key-service</name> <pactBroker> <url>https://XXXXXXX.pact.dius.com.au:443/</url> <authentication> <scheme>bearer</scheme> <token>1-A-XXXXXXXXXXX</token> </authentication> </pactBroker> </serviceProvider> </serviceProviders> </configuration> </plugin> Im trying to run the code which i have cut part of it above. when i use the Spring it works. But when i use @ExtendWith(PactVerificationInvocationContextProvider.class)``` i got the following error : java.lang.IllegalArgumentException: Invalid pact broker host specified ('${pactbroker.host:}'). Please provide a valid host or specify the system property 'pactbroker.host'.

bethskurrie
2020-04-27 22:16
Sorry, you'll need to ask in the JVM channel.

bethskurrie
2020-04-27 22:16
Also, make sure you've found the docs.

bethskurrie
2020-04-27 22:17
They can be a bit hard to find for some reason.

mbieganski.infomatt
2020-04-28 14:55
@bethskurrie Thank you very much. Workshop was really useful and I ended up with below setup: 1. Normal Provider pipeline run tests against consumer tagged master and prod. Additionally for master branch it runs can-i-deploy --to prod and creates version tag 2. Webhook provider pipeline - it's using pact url and consumer tags passed from webhook triggered by 'contract content changed' 3. Consumer pipeline - publish contract, can-i-deploy --to prod Is it possible to use pending pacts and wip in junit implementation? I have noticed that url is supported from 4.0.6

waquino
2020-04-28 19:15
Hi :slightly_smiling_face: does anybody know how big the POSTGRESQL database should be to deploy the OSS pact broker?

uglyog
2020-04-28 23:04
Not big at all. My calculations show that an empty broker database uses about 100Mb disk space, and for a broker that has been running for a while I've seen about 650Mb of disk space used by data

waquino
2020-04-29 02:08
oh great thanks :slightly_smiling_face:

bethskurrie
2020-04-29 23:55
The pact content gets deduped, so only unique documents are saved in the database.

bethskurrie
2020-04-30 05:49
This looks good ^^.

bethskurrie
2020-04-30 05:49
I believe that the ability to run a verification without it failing the build is not yet supported @mbieganski.infomatt

shilpa3006
2020-04-30 15:00
Hi Beth, Pact broker is on my local machine. So, able to access using local host url. When I tried with ip instead of localhost, it?s not working and hence not able to integrate in CI. Can you please let me know if I need to change any configuration to get this working?

matt.fellows
2020-04-30 22:11
Shilpa are you pointing your CI to your local machine? Why?

matt.fellows
2020-04-30 22:11
Also, this is a networking question. You need to ensure your IP address within the network is publically accessible to the network

matt.fellows
2020-04-30 22:12
We can debug that for you I'm afraid, I'd recommend finding an operations like person that knows how it's all setup

shilpa3006
2020-05-01 00:10
Ok thanks Matt. I will check.

shilpa3006
2020-05-01 00:11
Pact broker is in my local - just for pic purposes

shilpa3006
2020-05-01 00:11
Poc

shilpa3006
2020-05-01 00:13
Also, another question- if we don?t want to use pact broker and just use Common bitbucket repo between consumer and provider that should work right?

bethskurrie
2020-05-01 00:14
You can, but you'll miss out on a lot of features.

bethskurrie
2020-05-01 00:14
A CI/CD pipeline that prevents breaking changes being deployed is not possible without a Pact Broker.

bethskurrie
2020-05-01 00:15
You'll need to work out how to communicate the status of the verification results from the provider back to the consumer.

bethskurrie
2020-05-01 00:15
You'll need to work out how to trigger a verification build of the provider when the pact content changes (and ideally only when it changes).

bethskurrie
2020-05-01 00:16
You'll have to manually work out how to make the prod pact available so that you can ensure backwards compatibility.


kaypee90
2020-05-01 00:17
has joined #pact-broker

bethskurrie
2020-05-01 00:18
You're not going to get the full value of using Pact. The actual Pact generation and verification is only a very small part of the overall picture.

shilpa3006
2020-05-01 00:18
We are not deploying in prod using ci/cd. We currently use it only in test regions

bethskurrie
2020-05-01 00:19
Well, pacts in repositories are better than no pacts - just keep in mind that there's a much bigger picture than just that.

shilpa3006
2020-05-01 00:26
As far as I understand, pact is very useful if a provider has multiple consumers and would give confidence to both providers( before deploying) and consumers (only when interactions change). If consumers are good with initial interactions or initial pact and if we don?t anticipate more changes from consumer then what would be the role of pact broker?

bethskurrie
2020-05-01 00:32
You're right, it's more useful when interactions are changing. For that particular consumer/provider, if there are no changes, you should be fine. The thing is... how far in the future can you see? :wink:

shilpa3006
2020-05-01 00:43
Ok. Got it Beth. Thanks for explanation.

kaypee90
2020-05-01 13:51
I am trying to verify and publish my verification results to the pact broker but I am getting this message ```Cannot publish verification for Business-Report-BFF as there is no link named pb:publish-verification-results in the pact JSON. If you are using a pact broker, please upgrade to version 2.0.0 or later. ```

kaypee90
2020-05-01 13:52
Is there a way to fix this without having to update the broker?

bethskurrie
2020-05-01 21:16
What version is your pact broker @kaypee90?

bethskurrie
2020-05-01 21:18
The answer is no - if it's a very old version of the broker, it doesn't support publishing verification results. You'll have to upgrade. It should be straightforward.

dan.h.lee329
2020-05-02 01:55
has joined #pact-broker

sen.rudrappa
2020-05-02 06:52
has joined #pact-broker

simon.nizov
2020-05-02 12:22
Hi all, In my company we have multiple deployed environments, where each environemnt has a matching branch in each service repo. Each of these branches is considered a ?stable? branch that I would like to publish pacts and run pact verification for, seperately and independently. I have recently set up our CI so that the consumer service publishes pacts with the tag of the branch, and the provider runs verification on the pact that has a tag that matches the environemnt being deployed. For example, a push to the `qa` branch of the provider service will trigger a build that will run pact verification with the latest pact tagged with `qa`. If the verification is successful, the results will be published to the broker and the service will be deployed to the `qa` environment. This works well so far, however, if I now publish a pact in the `develop` env/branch, it will be considered the latest pact and the broker will display the pact ?Last verified? column in yellow. Due to this mismatch between envs, that column is yellow almost all the time :disappointed:. Has anyone else encountered this? Looks like the broker is not built for this kind of use. Should I be publishing results in only one branch/env?

mbieganski.infomatt
2020-05-03 12:24
Hi :slightly_smiling_face: I have small problem with broker and I'm wondering if I haven't messed up the configuration somewhere along the way. It's running on k8s. When I use below auth with scheme = "https" everything works just fine ```@PactBroker(host = "http://my.broker.eu", scheme = "https", authentication = @PactBrokerAuth(username = "user", password = "passsword"))``` When I try to use token ``` @PactBroker(host = "http://my.broker.eu", scheme = "https", authentication = @PactBrokerAuth(token = "sometoken"))``` I'm getting `Request to path '/' failed with response 'HTTP/1.1 400 Bad Request'` When I remove scheme as it's deprecated in both scenarios I'm getting `Request to path '/' failed with response 'HTTP/1.1 308 Permanent Redirect'` Any ideas? Thanks!

matt.fellows
2020-05-03 23:18
Are you using a Pactflow broker or your own? Only Pactflow supports token based authentication

bethskurrie
2020-05-03 23:21
@simon.nizov you can switch to the tag view. There's a link at the top right that says "show latest tags".


srinivasan.sekar1990
2020-05-04 04:17
has joined #pact-broker

simon.nizov
2020-05-04 13:39
Awesome, thanks!

mykeandreas_pact
2020-05-05 08:29
has joined #pact-broker

a.smith
2020-05-07 08:17
has joined #pact-broker

morten.hekkvang
2020-05-07 08:47
has joined #pact-broker

srinivasan.sekar1990
2020-05-07 12:12
Hi @bethskurrie Hope you are doing good. Have a query. We have a consumer who consumes data from two different provider micro-services where two provider micro-services has a separate pact broker each. Is it possible to publish to two different broker?

matt.fellows
2020-05-07 13:13
why do you have two brokers?

matt.fellows
2020-05-07 13:13
And yeah you can publish to both - what?s stopping you doing that?

matt.fellows
2020-05-07 13:14
Just run the publish step twice, but pointing to different brokers

srinivasan.sekar1990
2020-05-07 13:35
Consuming from different vendor's and they maintain it on their own :(

praneethkumar
2020-05-07 14:57
Hi All , we are trying to deploy pact broker in our open shift platform , but getting the below error . ?Error : container has runAsNonRoot and image has non-numeric user(Ruby) ,cannot verify user is non-root ? . Did anyone come across this issue ?

matt.fellows
2020-05-07 21:40
the passenger variant needs to run as root

matt.fellows
2020-05-07 21:41
so, the user _is_ non root


matt.fellows
2020-05-07 21:42
wow, ok

matt.fellows
2020-05-07 21:42
so vendors are exposing a public broker to you? or private?

bethskurrie
2020-05-07 21:49
Depending on your language, you should be able to filter to only publish the pacts that you want to each broker.

bethskurrie
2020-05-07 21:50
If you can't for some reason, you can just do a PUT to the correct URL like so: https://docs.pact.io/pact_broker/publishing_and_retrieving_pacts#publish-using-http-requests

shilpa3006
2020-05-08 03:12
Hi Matt/Beth..I am able to access other website on my machine externally but not pact broker...Able to ping my machine from other machines as well...but unable to get to pact broker...can you let me know how I can overcome this issue?

bethskurrie
2020-05-08 03:13
It sounds like your process is not mapped to 0.0.0.0 on your machine.

bethskurrie
2020-05-08 03:14
But there could be any number of issues like firewalls, being on the wrong subnet... it's too hard to diagnose the issue on someone else's machine I'm afraid.

bethskurrie
2020-05-08 03:14
Your best bet is to ask an ops person in your company to give you a hand.

bethskurrie
2020-05-08 03:15
Were you using the dockerised one?

srinivasan.sekar1990
2020-05-08 04:17
its private with auth

srinivasan.sekar1990
2020-05-08 04:21
Thanks @bethskurrie @matt.fellows

bethskurrie
2020-05-08 04:25
If you're starting it manually with the rack command (I have some memory that you're not using docker) then you need to add `-o 0.0.0.0`

matt.fellows
2020-05-08 05:02
We?d be keen to hear more about that use case if you?re able to elaborate.

srinivasan.sekar1990
2020-05-08 05:04
Sure Matt. Team consumes data from two different microservices from two different vendors. They have their own pact broker. So as a consumer of both microservices, we need to define individual contracts with each of the two broker.

matt.fellows
2020-05-08 05:05
Wow, so you have 2 separate vendors with Pact Brokers and they want you to publish pacts to them - may I ask who they are?

srinivasan.sekar1990
2020-05-08 05:06
Different organisations basically.

matt.fellows
2020-05-08 05:07
Interesting. It?s rare that one company would have a pact broker and make you publish to it. having two is also rare. If you?re willing to share in a DM I?d love to know more

matt.fellows
2020-05-08 05:08
Partly why it?s interesting, is that the broker isn?t optimised for this case, so it?s useful feedback

srinivasan.sekar1990
2020-05-08 05:16
Sure @matt.fellows

morten.hekkvang
2020-05-08 07:01
@bethskurrie Thanks for the fast response and merge of my Issue and PR on Github!

bethskurrie
2020-05-08 09:59
You're welcome. Thanks for contributing :slightly_smiling_face:

pyasi
2020-05-08 13:47
has joined #pact-broker

morten.hekkvang053
2020-05-10 08:40
has joined #pact-broker

matt.fellows
2020-05-11 00:04
Here is the Mux provider output in the pact-go repo.

matt.fellows
2020-05-11 00:04
If you can repro, please file a bug and I?ll look into it

bethskurrie
2020-05-12 03:23
for those using the dockerized version of the Pact Broker, please note that the format of the tag has changed from `M.m.p-RELEASE` to `M.m.p.RELEASE` (dot instead of dash) so that Dependabot can pick up when there has been a version change.

lewis.thorley
2020-05-12 09:13
has joined #pact-broker

borsuk.artem034
2020-05-12 13:17
Hello, I'm stack with deploy new app version(new pact stages was added). Can somebody help, maybe I missing something? My setup are: 1. Pact-broker with tagged environments (prod) 2. Already running verification via can-i-deploy for both sides ```.... broker can-i-deploy \ --pacticipant $APP_NAME(frontend or backend) --version $version(SHA) --to $ENVIRONMENT(prod)``` Problem: when pact is updating for fronted(31f7415) and backend(8242455). As a result I have success verification in PB (first line on screenshot), I can't deploy new version to "prod" environment because "There is no verified pact between.... frontend with tag prod and backend" What I should do for deploy new app versions? and save existing behavior with tagging?

matt.fellows
2020-05-12 13:31
`8242455` has not yet been deployed to production, assuming you create a version tag `prod` when that happens

matt.fellows
2020-05-12 13:32
that table says frontend version `31f7415` is compatible with the backend `8242455` but not the current `prod` version `f00dc94`

matt.fellows
2020-05-12 13:32
You need to a) deploy `8242455` to production b) tag it `prod` and then deploy your consumer

matt.fellows
2020-05-12 13:32
Are you trying to deploy them together or something?

borsuk.artem034
2020-05-12 13:49
but for deploying `8242455` I need to disable "can-i-deploy" step on provider side, (or do the disabling on consumer), but I don't want do that(deploy scripts stored in repo, it is few more commits for pact), I don't see possibility to deploy new version without changing script and revert this changes

borsuk.artem034
2020-05-12 14:07
I need to deploy new version of backend, and I will have a broken environment until new frontend version will be deployed, in the same time pact (can-i-deploy) prevent that situation, I'm really confusing now

shilpa3006
2020-05-12 14:10
Bundle exec rackup -o 0.0.0.0 -p 8080 I will try this...

tyler.rasor
2020-05-12 14:13
can you verify backend `8242455` with the current prod-tagged frontend `ecca3b2`?

shilpa3006
2020-05-12 14:19
This worked Beth :handshake:

shilpa3006
2020-05-12 14:19
Thanks :blush:

borsuk.artem034
2020-05-12 16:08
@tyler.rasor thanks for a good question, I was had missing verifications because provider do verification just for `latest` pact, but should be also checked `prod` tag (`ecca3b2` was no latest)

patrick.b.romo
2020-05-12 21:47
has joined #pact-broker

bethskurrie
2020-05-13 07:06
@borsuk.artem034 what version of the Pact Broker are you running?

bethskurrie
2020-05-13 07:07
There was an issue a while ago that stopped the provider being deployed without the consumer, but that's been fixed for a while.


bethskurrie
2020-05-13 07:10
```* allow provider to be deployed to an environment without the consumer having to be deployed there already (125c2722)```

bethskurrie
2020-05-13 07:11
Though, now I read all your comments, perhaps that's not the issue.

bethskurrie
2020-05-13 07:11
I'll have a look again later.

borsuk.artem034
2020-05-13 07:34
It is my fault for that issue, in provider I'm checked just `latest` contract, but we have 5 tagged environments. And as a result, missing verification has appeared, between old commits for `test` tag and `latest` contract version

bethskurrie
2020-05-13 07:40
That'll do it.

bethskurrie
2020-05-13 07:41
You'll want to verify the one in each environment

borsuk.artem034
2020-05-13 08:20
yep, in provider jvm add tags in annotation ```@PactBroker(......., tags = {"test01", "test02", "test03", "superTest", "prod", "latest"})``` after build provider I will have verification results for each deployed version and latest contract

siddharth.gupta
2020-05-13 08:23
Hi ,What is can-I-deploy equivalent in PactFlow

bethskurrie
2020-05-13 09:17
@siddharth.gupta it's the same. You just point the Pact Broker base url at your Pactflow account.

bethskurrie
2020-05-13 09:22
There's a new docker release out peeps. It's got a few little vulnerabilities fixed.

bethskurrie
2020-05-13 09:24
Remember to keep updated! Every few months github raises a vulnerability for some gem or another, so it's best to keep up to date.

dan.garland
2020-05-13 10:20
Hi all, what changes to the pact workflow are people using when using squash commits? We're currently having to re-publish pacts from our pipeline after merging into master to update the broker with the new sha created after squashing, so that it inherits the previous verification result. Is there a better way? What is the best practice?

bethskurrie
2020-05-13 10:20
That's the only way I can think of.

matt.fellows
2020-05-13 10:20
Why would you not republish you pacts anyway?

bethskurrie
2020-05-13 10:20
You've made a new consumer version, effectively. You need to associate the new pact with that consumer version.

matt.fellows
2020-05-13 10:22
I don't see that causing issues, aside from maybe ggravating any inherent OCD it brings on knowing you have to do it twice :laughing:

bethskurrie
2020-05-13 10:24
If your CI runs on every commit, wouldn't it just automatically re-publish the pact anyway?

bethskurrie
2020-05-13 10:24
If I've got a PR open, and I squash all the commits in that PR, then the build runs when I push my squashed commit.

bethskurrie
2020-05-13 10:25
If I squash on merge, then the build runs for the merge commit too. Both of those would be publishing a pact without me having to take any action because the pact publication is part of the build anyway. I'd have to change to something to make it *not* publish a pact.

bethskurrie
2020-05-13 10:27
The broker detects duplicate pacts anyway, so it doesn't create a new JSON blob, it just creates a new association between the blob and the consumer version. You can republish the same pact as many times as you like without affecting the size of the database in any significant way.

bethskurrie
2020-05-13 10:31
Maybe there's something different about your pipeline @dan.garland?

dan.garland
2020-05-13 10:39
No that's our setup too - it's just if we were running merge commits the SHA wouldn't change from when the verification runs in the PR environment to when our master build pipeline runs, so there wouldn't be a need to re-publish the pact, whereas since we follow a squash commit strategy unless we republish the pact on master with identical content the broker won't know about the new SHA... so seems like publishing twice is the only way to do it

bethskurrie
2020-05-13 10:39
yup - it's fine.

bethskurrie
2020-05-13 10:40
wouldn't it be more work to not publish though?

bethskurrie
2020-05-13 10:40
you'd have to write logic to detect it was a merge commit and then turn off the publishing... or am I missing something here?

bethskurrie
2020-05-13 10:41
pretty much every pact publication is identical to the one previous to it. think how many times you change the pact vs how many times you commit.

bethskurrie
2020-05-13 10:43
the fact that the content is generally identical to the previous commit is actually one of the value props of using a Pact Broker over some DIY workflow - the duplicate detection and "pre-validation" means you don't have to wait for the provider build to run and publish its results 99% of the time.

ppaduch
2020-05-13 20:08
Hi All , I would like to start using pending pacts. As far as I know it is in beta testing phase. On our site we have been tagging contracts and use can-i-deploy. Where could I get instructions how to implement and use this new interesting feature ? Thanks , Pawel

matt.fellows
2020-05-13 23:00
Hi @ppaduch, which language are you using?

ppaduch
2020-05-14 04:55
mainly we work with javascript (node.js)


bethskurrie
2020-05-14 05:55
And if you're using the OSS Pact Broker (rather than pactflow) you'll need to set an environment variable for the broker.

bethskurrie
2020-05-14 05:56
PACT_BROKER_FEATURES=pacts_for_verification

ppaduch
2020-05-14 06:32
thanks , which docker image of pact broker shall I use ? the latest one ?

antonello
2020-05-14 06:42
Hello! I was looking through the change log of recent releases and I found this: https://github.com/pact-foundation/pact_broker/commit/bc457492 What clean feature is it referring to? Is there now some cleanup functionality available through the ui?

bethskurrie
2020-05-14 07:04
I've written the code, but haven't exposed it through an api yet @antonello

bethskurrie
2020-05-14 07:05
I want to add a configurable task that runs once a day on a cron to clean up old data.

antonello
2020-05-14 07:05
That would be amazing

antonello
2020-05-14 07:05
I did a bit of cleanup in the last couple of days and it it was quite laborious as it had to be done in batches

hans.brouwer
2020-05-14 07:18
has joined #pact-broker

antonello
2020-05-14 07:27
I need to spend up some time to write some more selective queries based on tags

antonello
2020-05-14 16:10
Is it possible to delete a TAG completely for a pacticipant and not just delete it from a specific version?

bethskurrie
2020-05-14 21:56
Delete every single instance of that tag for a pacticipant @antonello? No - but feel free to raise a feature request issue for it.

bethskurrie
2020-05-14 21:56
Would you want to delete the versions as well, or just remove the tags?

antonello
2020-05-14 22:14
In the use case that came up today, just the tags

antonello
2020-05-14 22:14
I assume that all versions can be deleted already? I think I saw somewhere a resource for all versions with a specific tag


bethskurrie
2020-05-14 22:15
Actually, those delete the pacts, not the versons.

aleksmarg
2020-05-15 06:07
has joined #pact-broker

raghu.alapati1
2020-05-16 00:26
has joined #pact-broker

raghu.alapati1
2020-05-16 01:40
HI Team, please can you some one shed some light on the below error when trying to publish... ""publish:pact": "pact-broker publish ./pacts --consumer-app-version=1.0.0 --broker-base-url --broker-base-url https://testbank.pact.dius.com.au --broker-token 91x4qt7fEK6slF_IvEEDaA". Error>>. Publishing Consumer/Provider pact to pact broker at https://testbank.pact.dius.com.au Failed to publish Consumer/Provider pact due to error: PactBroker::Client::Error - Authentication failed

raghu.alapati1
2020-05-16 01:40
using latest "@pact-foundation/pact": "^9.10.0",

bethskurrie
2020-05-16 01:41
Please reset your token!

raghu.alapati1
2020-05-16 01:41
i tried over 5 times...

bethskurrie
2020-05-16 01:41
You've just published it in clear text for the world to see.

bethskurrie
2020-05-16 01:42
Firstly, are you using a read/write token, or a read only one?

raghu.alapati1
2020-05-16 01:42
i will change it. promise.

raghu.alapati1
2020-05-16 01:42
read only...

bethskurrie
2020-05-16 01:42
well.. there you are :wink:

bethskurrie
2020-05-16 01:42
You can't publish with a read only token.

raghu.alapati1
2020-05-16 01:43
so sorry. apologies.

raghu.alapati1
2020-05-16 01:43
honestly tried before...but it failed. Sincere apologies for a silly question.

bethskurrie
2020-05-16 01:43
no worries

arindam.datta
2020-05-16 08:42
has joined #pact-broker

kameda.sbng
2020-05-17 02:37
has joined #pact-broker

antonello
2020-05-18 08:45
Do you reckon it would be useful to just be able to remove a tag from all versions?

bethskurrie
2020-05-18 08:46
You tell me!

antonello
2020-05-18 08:46
it would be in our case, but I wonder if I should create an issue if it?s something that you think would be an isolated case

bethskurrie
2020-05-18 08:47
Nobody else has asked for it in 7 years. But you guys have more data than almost anyone else, so your use cases are different.

bethskurrie
2020-05-18 08:48
You could put it in http://pact.canny.io and see if anyone else votes for it

antonello
2020-05-18 08:49
that?s fair

praneethkumar
2020-05-18 14:09
Hi All , if anyone has successfully deployed the pact broker puma version to open shift , can you please share the yml if you can ?


bethskurrie
2020-05-19 07:07
You should just need to change the image and the port it runs on.

koen.roevens
2020-05-20 09:10
has joined #pact-broker

mike.geeves
2020-05-20 10:37
has joined #pact-broker

mike.geeves
2020-05-20 10:43
Question - we are running the pact-broker via docker, where we deploy everything into a k8s cluster which then has an API gateway, and deployments are then wired in automatically. That works to an extent for pact-broker, but the UI is "broken" due to the fixed path, as per: _PACT_BROKER_BASE_URL - optional. If you find that the URLs generated by the API are using an IP instead of a hostname, you can set this environment variable to force the desired base URL. Must include the port if it's a non-standard one. eg. `https://my-broker:9292`. Is not currently used for links in the UI._ For now I've just set it up as a special case to have an IP all to itself which works but isn't ideal (small additional cost, bypasses our auth etc). I can't see anything in the issues about this - does anyone know if it's planned to be implemented at some point? (I haven't looked through the code to see if there's some horrible complexity that means it works ok for one part but not the rest)

bethskurrie
2020-05-20 21:30
Hi @mike.geeves. Which urls on the UI are affected?

bethskurrie
2020-05-20 21:32
I wonder if there's a reverse proxy sitting in the mix


bethskurrie
2020-05-20 21:33
I think the reason this happens is that the x forwarded headers aren't set, so when it's recreating the incoming request, it only knows about the last hop to the IP, not the original request to the host name.

bethskurrie
2020-05-20 21:33
It probably wouldn't be too hard to fix the UI links, it's just not bubbled to the top of the priority list.

bethskurrie
2020-05-20 21:34
I'm surprised it affects the UI though - I thought they were all relative links :thinking_face:

mike.geeves
2020-05-20 22:34
I think all the styling, it's an extra level of reverse proxy than is covered there, our general approach is project ag-pact-broker for example is wired in as http://our.api.com/ag-pact-broker i.e. the project name becomes the path. I didn't check the HAL browser :thinking_face: Can try and provide a SSCCE / look at links in the morning if helpful (or possibly take a look if a issue+MR would be small enough?)

bethskurrie
2020-05-20 22:51
Ooh, yeah, the extra path.

bethskurrie
2020-05-20 22:51
That's an open issue.

bethskurrie
2020-05-20 22:51
There aren't that many links in the UI

bethskurrie
2020-05-20 22:52
It wouldn't be too much work to add a base url to them.


mike.geeves
2020-05-20 23:08
:facepalm: completely missed that title when i skimmed through issues

mike.geeves
2020-05-20 23:16
will attempt to take a look although dependence on how much ruby specific vs general dev skills involved :slightly_smiling_face:


bethskurrie
2020-05-20 23:54
It'll be quicker for me to do it than explain by now I think.

thinh.tranquoc
2020-05-21 02:23
has joined #pact-broker

mike.geeves
2020-05-21 12:52
Oh thank you, I wasn't expecting a fix right away :slightly_smiling_face: I'm going through outcomes from our pact spikes to figure out what to plan in next etc. I think I need to adjust my phrasing on here, I'm not used to.... quick positive interactions. Jaded :joy: Appreciated :slightly_smiling_face:

lankala321
2020-05-21 13:48
has joined #pact-broker

bethskurrie
2020-05-22 05:58
I've just kicked off the build for the image with tag 2.55.0.0

bethskurrie
2020-05-22 05:59
It should allow you to set PACT_BROKER_BASE_URL to something that has a path.

bethskurrie
2020-05-22 05:59
I've been meaning to do it for ages.

mike.geeves
2020-05-23 12:39
:+1: thanks, will check it out

deepakverma
2020-05-26 00:42
So I have a working pact with postgres. followed the doc https://github.com/DiUS/pact_broker-docker/blob/master/POSTGRESQL.md and seems working fine. One question why pact need ALL permission on postgres. is there any suggested min permission we can set than using `GRANT ALL PRIVILEGES` . doc link will be great help

bethskurrie
2020-05-26 00:43
It needs to be able to run the migrations.

bethskurrie
2020-05-26 00:43
So it has to be able to create tables, delete tables etc.

deepakverma
2020-05-26 00:45
Thanks @bethskurrie much appreciate it. if we explicitly provide create and delete that should do the trick as well. currently user has all the elevated privileges. and if i have to run the test through external CI it seems to be quite exposed

bethskurrie
2020-05-26 00:45
but your user should be scoped only to the database

bethskurrie
2020-05-26 00:45
not other databases - it can only destruct its own!

deepakverma
2020-05-26 00:45
yes true

bethskurrie
2020-05-26 00:46
what is your concern if the user is scoped to its own database?

deepakverma
2020-05-26 00:52
yes you made a valid point. i am concerned that user has drop permission not on other but its own database. there is some level of disruption involved here.

bethskurrie
2020-05-26 00:54
well, just make sure you've given the user everything it needs if you're going to go down that route.

bethskurrie
2020-05-26 00:55
it'll need all permissions on tables and views

bethskurrie
2020-05-26 00:55
if you can delete a table... you can delete everything in the whole database though.

bethskurrie
2020-05-26 00:55
it'd just take longer!

bethskurrie
2020-05-26 00:55
to give the app enough permissions to be useful, you already give it enough to be dangerous.

bethskurrie
2020-05-26 00:56
I think the best approach to mitigate this is to ensure you have a good backup scheduled.

deepakverma
2020-05-26 00:58
yes true thank you for your help

bethskurrie
2020-05-26 00:58
the other alternative, now I think about it, is to turn off the automigrations, and run the rake task yourself with a completely different user than the one you configure the app with.

bethskurrie
2020-05-26 00:59
you'd need to ensure that you'd run the migrations before you applied any upgrade to the app code.

deepakverma
2020-05-26 01:17
thank you i will give it a go


mike.geeves
2020-05-26 09:21
The pact broker goes in its own schema, so you only need to have perms for that schema rather than the whole db as far as I understood. We just created the schema, granted full access within the schema, and then it did the rest via the migration (didn't do the steps myself, but that's my understanding from the person who went through the setup on our side)

bethskurrie
2020-05-26 09:22
Agreed.

bethskurrie
2020-05-26 09:22
The terminology is somewhat overloaded - I mean "schema" when I say "database".

mike.geeves
2020-05-26 09:23
:+1:

bethskurrie
2020-05-26 09:23
database can mean so many things! it's very annoying.

mike.geeves
2020-05-26 09:23
that level of "blast radius" is fine for us

mike.geeves
2020-05-26 09:23
....

mike.geeves
2020-05-26 09:24
you think that's a problem, we work in agriculture... so there's a "field" table :facepalm:

mike.geeves
2020-05-26 09:24
:joy:

bethskurrie
2020-05-26 09:24
hahaha

praneethkumar
2020-05-28 11:10
Hi all , I am trying to install broker in open shift and getting below error . chmod: changing permissions of ?/var/lib/pgsql/data/userdata : Operation not permitted. Did anyone face similar issue ?

matt.fellows
2020-05-28 11:14
That looks like you?re trying to run _postgres_ on openshift

matt.fellows
2020-05-28 11:14
and the volume data is mounted on a directory that is not writeable

praneethkumar
2020-05-28 11:20
Thanks Matt..I will review and see if we can change the directory

matt.fellows
2020-05-28 11:31
My point is, basically, that you should google how to run postgres on OpenShift (it doesn?t look to be a Pact broker issue)

praneethkumar
2020-05-28 17:09
We managed to fix the issue ..now when I access the broker url it is asking for username & password . Are there any default values ?

bernardoguerr
2020-05-28 17:45
I think if you didn't set any , on the OSS you can just press enter with no values there (I think there's a flag to prevent that too, iirc)

oscarg798
2020-05-29 07:16
has joined #pact-broker

samuel.hodgkinson
2020-05-29 16:26
Is there a way to track build url or git repository or something on the open source broker? Some extra metadata we can send when posting pacts or something? Would be useful for seeing who owns what and tracking down errors

bethskurrie
2020-05-29 21:58
Yes @samuel.hodgkinson

bethskurrie
2020-05-29 22:00
PUT /pacticipants/PACTICIPANT {repositoryUrl: 'http://repository'}

bethskurrie
2020-05-29 22:01
It shows up in the network diagram page.

bethskurrie
2020-05-29 22:02
Also, you can send the build url with the verification results, but not all clients make it available in the api. Raise an issue if it's missing in yours.

dale.bennett
2020-06-01 08:09
has joined #pact-broker

uladzimir.sadouski
2020-06-01 21:15
has joined #pact-broker

bheemreddy181
2020-06-02 22:26
Team , quick thought around pact broker - right now on pact broker when ever we look at each pact it shows the request from the consumer and the expected response but it doesn?t talk about the matchers in that unless I do GET on pacts. I think it will be good show the matchers as well directly when we look at each pact rather than doing a GET again thoughts ?

matt.fellows
2020-06-02 23:36
PR welcome!

matt.fellows
2020-06-02 23:36
We show it in Pactflow because it?s useful

bheemreddy181
2020-06-03 00:51
Ah got it :) can you share the look and feel for it ? On the Pactflow will take a look and see if I can submit a PR

bheemreddy181
2020-06-03 01:08
Ah makes sense :pray::skin-tone-3: looks really great

ramfjordm
2020-06-03 10:17
has joined #pact-broker

shawn.edge
2020-06-03 13:48
has joined #pact-broker

mbieganski.infomatt
2020-06-03 14:07
Hi. I have a question about displaying pending pacts in Pact Broker. Once this feature is enabled In my case when contract is changed it will trigger web-hook of provider verification job. Previously without this pending feature enabled job would fail but now it passes. Is it correct that Broker on the Matrix shows that Pact was verified and main page that Pact has changed. Shouldn't fail status be displayed? Unless I'm doing something not right.

bethskurrie
2020-06-04 08:36
It should display as failed.

bethskurrie
2020-06-04 08:36
If there was a verification failure that is - if it passed, it'll be successful.

bethskurrie
2020-06-04 08:37
What's the output from the test that failed in pending mode?

mbieganski.infomatt
2020-06-04 08:38
I made some configuration error :disappointed:

mbieganski.infomatt
2020-06-04 08:39
but with pending pacts should pipeline fail when verification test fail or it should still pass but in broker marked as failed?

bethskurrie
2020-06-04 08:39
Build passes, pact is failed in broker.

mbieganski.infomatt
2020-06-04 08:39
hmm

bethskurrie
2020-06-04 08:40
You can do the ci/cd workshop to see this in action


bethskurrie
2020-06-04 08:41
Oh, on the webhook, if you're passing the URL through, it won't do the pending thing.

mbieganski.infomatt
2020-06-04 08:41
I read it that's why I'm confused. I have also asked @uglyog in this thread https://pact-foundation.slack.com/archives/C9UN99H24/p1591245684425900

bethskurrie
2020-06-04 08:41
Pending only applies when you are fetching pacts from the broker.

bethskurrie
2020-06-04 08:41
There are two modes for verification

bethskurrie
2020-06-04 08:42
One when the consumer changes, and the pact url gets passed directly to be verified, via the webhook.

mbieganski.infomatt
2020-06-04 08:42
ahh ok so it doesn't aply to webhook pipeline when passing url

bethskurrie
2020-06-04 08:42
Two, when the provider changes, and it fetches the configured pacts by tag name.

mbieganski.infomatt
2020-06-04 08:42
but only main pipeline when running provider

bethskurrie
2020-06-04 08:42
Yes

bethskurrie
2020-06-04 08:43
The webhook verification build is meant to be off side, not the main provider build

bethskurrie
2020-06-04 08:43
So it doesn't matter if that one fails. It's expected to.

mbieganski.infomatt
2020-06-04 08:43
yeah got it now


mbieganski.infomatt
2020-06-04 08:46
could you please into the thread I sent and just confirm ?

phil.endsley
2020-06-04 12:27
has joined #pact-broker

phil.endsley
2020-06-04 13:11
We're just starting to dip our toes into pacts. We're using Pact Broker and have some contracts being published and verified. Our next step was to start utilizing tagging and can-i-deploy. For the most part, everything makes sense. The part I'm hung up on is tagging for prod. My understanding is that we would tag prod when we deploy. But what happens if a deployment/release needs to be rolled back? From what I understand, we would still be verifying contracts and calling can-i-deploy against the latest prod tag, which would be the version/release that was rolled back. How is this situation supposed to be handled?

matt.fellows
2020-06-04 23:22
Standard advice is that you would always verify the `prod` tag and also the tag that represents what?s going out next (e.g. `master`)

matt.fellows
2020-06-04 23:22
If you rollback, you can always re-apply the `prod` tag to what is in prod (i.e. the rolled back version)

matt.fellows
2020-06-04 23:23
How you do that tagging is going to depend on how you rollback of course

matt.fellows
2020-06-04 23:23
if the rollback is a deployment, then that should be easy - tag the same way you do a normal release

matt.fellows
2020-06-04 23:23
if it?s different you?ll need to update the rollback process to add the version tag

bethskurrie
2020-06-04 23:24
Sorry, @matt.fellows rollback is a bit tricker.

bethskurrie
2020-06-04 23:25
You can't just reapply the prod tag to the redeployed version.

bethskurrie
2020-06-04 23:26
The logic for "the latest prod pact" is done by finding the most recent application version that has a pact, that also has the 'prod' tag. The ordering is based on the order of the application (pacticipant) versions, not the ordering of when the tags were made.

bethskurrie
2020-06-04 23:26
If you need to rollback, you must delete the prod tag from the version you undeployed.

bethskurrie
2020-06-04 23:27
I've got an issue for making the CLI for that in the pact broker client, but in the meantime you can just send a DELETE to the tag resource which will be at `https://your-broker/pacticipants/PACTICIPANT/versions/VERSION/tags/prod`

matt.fellows
2020-06-04 23:28
OK I thought that might have been the case, sorry and thanks Beth

matt.fellows
2020-06-04 23:29
Is that in our CI/CD guide? that would be a good addition to add (rollback)

bethskurrie
2020-06-04 23:29
No - I'll add it.

bethskurrie
2020-06-04 23:29
Not many people rollback these days so it doesn't come up very often :stuck_out_tongue:

matt.fellows
2020-06-04 23:29
never look back!

phil.endsley
2020-06-04 23:30
Thanks. This was the workaround I came up with today. I wish we were stable enough to avoid them :slightly_smiling_face:

phil.endsley
2020-06-04 23:30
It takes a lot of momentum to change a company's culture. We'll get there some day

thomas.koerner
2020-06-05 07:50
has joined #pact-broker

slack.pact.io
2020-06-05 11:40
has joined #pact-broker

slack.pact.io
2020-06-05 11:42
Hi all, I have question: for outgoing webhooks is there a way to skip ssl validation? something like `--insecure` on curl?


slack.pact.io
2020-06-05 12:57
Thanks Matt! I am trying to overcome what I think is a URL mismatch issue. But also I didn't know there is a whitelist for webhooks that I also need to setup :smile: We are using the dockerised version (actually the old dius one) and I saw the `PACT_BROKER_DISABLE_SSL_VERIFICATION` env var on the docs for pact-foundation/pact-broker-docker. Just wondering if there is a way to set this up on case by case basis and not globally

anddreiu
2020-06-05 14:31
has joined #pact-broker

bethskurrie
2020-06-05 21:21
There isn't an individual flag @slack.pact.io unfortunately. It's all or nothing. Is uploading the certificate not working?

arindam.datta
2020-06-06 05:14
Hi, can anyone please help me with a proven workflow of CI-CD for both Provider and Consumer? Just block diagram would do. I am finding this part pretty complex and hard to decide the flow. I know that probably I am asking for too much. But I found members of pact slack channel so helpful which gave me confidence to ask for such a help.

arindam.datta
2020-06-06 05:16
This is the last puzzle I need to solve

bethskurrie
2020-06-06 05:25
Sorry, this is not the page I want to send, but we've just converted our docs to a new site, and this image hasn't made its across yet


bethskurrie
2020-06-06 05:26
Also have you seen the ci/cd workshop? https://docs.pactflow.io/docs/workshops/ci-cd/

sairsule
2020-06-06 11:47
has joined #pact-broker

sjuli.chen
2020-06-06 20:22
has joined #pact-broker

mbieganski.infomatt
2020-06-07 19:38
hi. How to handle can-i-deploy in cd when deploying provider first time for consumer with given tag e.g "prod" when it haven't been deployed yet as well?CI/CD pipeline after merging to master runs can-i-deploy, deploy and tag.

sadeed.bari
2020-06-08 05:41
has joined #pact-broker

steven.knopf
2020-06-08 08:32
has joined #pact-broker

thomas.fisher
2020-06-08 09:06
has joined #pact-broker

r.iglesias
2020-06-08 09:34
has joined #pact-broker

slack.pact.io
2020-06-08 09:49
Thanks Beth. I haven't tried with the custom certificate yet. Without being 100% certain, I don't it would work though, as my main problem is that the certificate is made for a different URL. I am trying to route the connection via a VPC endpoint (whose url is `http://something.vpce.amazonaws.com` that ultimately connects to a service presenting the certificate for `somethingelse.mydomain.local`). One thing I could try for this would be to make a new certificate that includes the `http://amazonaws.com` URL but that might be an overkill.

bethskurrie
2020-06-08 09:52
Tricky. Yeah, it's all or nothing at the moment.

bethskurrie
2020-06-08 09:52
You can raise a feature request at http://pact.canny.io and see if it get some votes.

bethskurrie
2020-06-08 09:53
@mbieganski.infomatt when it's a provider only, you can deploy to any environment for the first time.

bethskurrie
2020-06-08 09:54
You can't deploy a consumer for the first time to a given environment without the provider being present however.

bethskurrie
2020-06-08 09:55
So, basically, you can run "can-i-deploy --pacticipant some-app-that-is-only-a-provider --to <any-environment>" and it will pass.

bethskurrie
2020-06-08 09:56
If you tried that with a consumer, it would fail because it requires the provider to already be there.

mbieganski.infomatt
2020-06-08 09:56
Thanks :slightly_smiling_face:

slack.pact.io
2020-06-08 10:00
Cool. I will, thanks :+1:

rafael.espillaque
2020-06-08 12:51
has joined #pact-broker

karol.szymanowski
2020-06-09 08:08
has joined #pact-broker

cristian.schez
2020-06-09 11:21
has joined #pact-broker

mbieganski.infomatt
2020-06-09 15:18
Hi. Is it correct behaviour that even when contract hasn't changed after new commit there is warning in Pact Broker "Pact has changed since last successful verification by.." I might be crazy but I think it didnt work this way :thinking_face:

phil.endsley
2020-06-09 15:30
I'm relatively new to Pacts, but this is not how I understand it to work. Are you sure the contract is identical? Here's a link on how to see what changed. https://github.com/pact-foundation/pact_broker/wiki/How-to-see-what-has-changed-in-a-pact Pact Broker hashes the pact file. If the hash hasn't been seen, the contract has changed, and it needs to be verified. If it has been seen, Pact Broker will reuse the verification results for any versions that have already been verified. https://docs.pact.io/getting_started/versioning_in_the_pact_broker#consumer-application-versions

mbieganski.infomatt
2020-06-09 19:30
Looks like the problem `matchPath(String pathRegex)` . When I use `matchPath(String pathRegex, String path)` it works. I'm pretty sure it worked before.. wondering if it's Pact Broker, java implementation issue or expected behavior.

matt.fellows
2020-06-09 23:34
If you don?t pass a specific path (the second argument) Pact JVM generates a random one

matt.fellows
2020-06-09 23:34
that will be different each time, and so will result in a new contract each time

godfrey
2020-06-10 07:34
has joined #pact-broker

elliottmurray
2020-06-10 16:37
has joined #pact-broker

bradley.smith
2020-06-11 05:15
has joined #pact-broker

sreeharimohan11
2020-06-11 06:44
has joined #pact-broker

sandhyareddy019
2020-06-12 07:40
has joined #pact-broker

sandhyareddy019
2020-06-12 07:42
Hi, i am new to this tool. can any one help me how to go along with pact ? like how to install pact in windows and using jenkins i want to test pact, is there any plugin for pact in jenkins.

wvdbraak
2020-06-12 07:50
has joined #pact-broker

bethskurrie
2020-06-12 08:02
Reading http://docs.pact.io is the best way to learn about pact. There is no Jenkins plugin because it runs from within the test suite of the codebase.


sandhyareddy019
2020-06-12 08:05
thank you so much

bethskurrie
2020-06-12 08:05
You can you can try it out online here https://docs.pact.io/5-minute-getting-started-guide

bethskurrie
2020-06-12 08:05
There's a CI/CD workshop here


sandhyareddy019
2020-06-12 08:06
with jenkins pipeline is it not possible?

bethskurrie
2020-06-12 08:07
The type of pipeline makes no difference

bethskurrie
2020-06-12 08:07
Learn the theory, and then apply it to jenkins. There's nothing special about Pact on jenkins

sandhyareddy019
2020-06-12 08:08
like i want to execute pact in jenkins?

bethskurrie
2020-06-12 08:09
It's like asking, "I want to learn how to run tests on jenkins". You run tests on jenkins the same way you run tests on any CI system.

sandhyareddy019
2020-06-12 08:10
yeah to test in jenkins is there any plugins to be added in jenkins for pact ?

bethskurrie
2020-06-12 08:13
No

bethskurrie
2020-06-12 08:13
It just runs as part of the normal test suite.

sandhyareddy019
2020-06-12 08:13
ok

bethskurrie
2020-06-12 08:14
Please do read the docs, and do the workshops

bethskurrie
2020-06-12 08:14
There a Java workshop too.

bethskurrie
2020-06-12 08:14
I assume you're on Java?

sandhyareddy019
2020-06-12 08:15
no

bethskurrie
2020-06-12 08:16
Which language?

matt.fellows
2020-06-12 10:39
I'd start with running it locally @sandhyareddy019

matt.fellows
2020-06-12 10:39
Once you've got some tests running locally you can then install on jenkins

matt.fellows
2020-06-12 10:40
You're asking in the pact broker channel. Is that because you want to know how to install the pact broker?

mbieganski.infomatt
2020-06-12 14:16
@matt.fellows Was it always this way? I'm just wondering what is the point of having match implementation without example value?

sandhyareddy019
2020-06-15 06:56
Hi, i want to create API in mulesoft and use pact in it. later i want to test pact using jenkins platform . is that possible ? and i am confused how to start with pact in mulesoft.

bethskurrie
2020-06-15 06:57
Pact tests are agnostic of the CI system.

matt.fellows
2020-06-15 06:57
I mean, I don?t see why not

matt.fellows
2020-06-15 06:57
Is there a particular thing you?re concerned about?

matt.fellows
2020-06-15 06:57
If a) you can write a consumer test, b) you can verify the API and c) can script in Jenkins, then you can do anythnig

sandhyareddy019
2020-06-15 06:57
sorry i didnt get u

sandhyareddy019
2020-06-15 06:58
do u have any example you can share with me

matt.fellows
2020-06-15 06:58
Pact doesn?t care about what CI it runs on

matt.fellows
2020-06-15 06:59
so if you can script in Jenkins, there is no reason why it wouldn?t work with Jenkins

matt.fellows
2020-06-15 06:59
with Jenkins? No sorry

matt.fellows
2020-06-15 06:59
This is a travis CI example though: https://docs.pactflow.io/docs/workshops/ci-cd/

sandhyareddy019
2020-06-15 07:00
no in mulesoft

matt.fellows
2020-06-15 07:00
are you talking about running the Pact Broker (or using http://Pactflow.io) or the CI/CD process altogether?

matt.fellows
2020-06-15 07:00
Ah, not mulesoft sorry

matt.fellows
2020-06-15 07:00
Might be worth asking in #general to see if anybody has used it

sandhyareddy019
2020-06-15 07:01
yeah something like that

sandhyareddy019
2020-06-15 07:04
ok excluding mulesoft can you help me with any example file of how pact is implemented in an api . so using that i can create in mulesoft

matt.fellows
2020-06-15 07:04
what language

sandhyareddy019
2020-06-15 07:05
like java

matt.fellows
2020-06-15 07:05
have you read the docs? There is an entire workshop mentioned there that would be worth doing


sandhyareddy019
2020-06-15 07:07
ok

sandhyareddy019
2020-06-15 07:09
i saw many articles mentioning about docker ? i didnt get that . is docker mandatory to get in with pact?

matt.fellows
2020-06-15 07:09
no

matt.fellows
2020-06-15 07:10
what did the articles say about it?

matt.fellows
2020-06-15 07:10
which articles?

sandhyareddy019
2020-06-15 07:12
even in the above link in travis they mentioned docker service. i am unable to figure it out relation between docker and pact

matt.fellows
2020-06-15 07:14
It?s just a convenience thing. In that workshop, we use Pact CLI tools and run them in docker containers. Running things in docker makes it much more portable across CI systems, and because docker is so popular, we?ve made it part of our examples

matt.fellows
2020-06-15 07:14
Docker is just the runtime for CI and can be a runtime for the pact broker. It?s not required for Pact testing, albeit most people likely use Docker in their CI builds somewhere

sandhyareddy019
2020-06-15 07:15
instead of docker what can i use?

sandhyareddy019
2020-06-15 07:15
what can be used*?

matt.fellows
2020-06-15 07:15
Think of Pact as a unit testing framework, and Pact Broker (and related tooling) as a CI/CD tool

matt.fellows
2020-06-15 07:15
Run the Java workshop, it will make more sense (it doesn?t use docker)

sandhyareddy019
2020-06-15 07:15
ok

josh.mccure
2020-06-15 23:36
Hey all - a bit of a theoretical question here. We've implemented PACT with the PACT broker and looking at how `can-i-deploy` fits into the CI/CD pipeline. Is it a good idea for this to be blocking the first deployment to an environment if it fails (This is Dev Environment for us)? Interested to know how this fits into your deployment process from Dev -> Staging -> Production

abubics
2020-06-16 00:04
Yes, I usually block deploys to any environment that expects shared components to be able to talk to each other without error :slightly_smiling_face:

abubics
2020-06-16 00:05
But it also depends on what the intent of those envs is. What do y'all use that dev env for, how is it different to staging & prod, and do you run other tests in isolated envs before shared deployments?

matt.fellows
2020-06-16 00:09
yep, it?s really up to you

matt.fellows
2020-06-16 00:10
I prefer to prevent the deployment, because that?s usually a sign the workflow isn?t setup right and you?re just kicking the problem can down the road (i.e. to prod)

matt.fellows
2020-06-16 00:10
also in case you haven?t seen it, https://docs.pactflow.io/docs/workshops/ci-cd/ might be helpful

josh.mccure
2020-06-16 00:14
Yeah my thinking is that it makes sense for this to be blocking for any deployment. Thanks for both your input. I think we will slot it in before deployment to Dev environment.

bethskurrie
2020-06-16 00:18
@josh.mccure for a full blown set up, you'd do it before every environment, tag with the environment name when you deploy to that environment, and then make sure your provider verifies the pact for each environment. That way, you build up a complete matrix of compatibility between each application in each env, and you will be able to release at any time.

bethskurrie
2020-06-16 00:20
new docker images are out for 2.57.0 There have been a few vulnerabilities fixed in Rack over the last few months, so always make sure you're up to date!

srikanth.chikkala
2020-06-16 04:03
has joined #pact-broker

linda.anthu
2020-06-16 08:41
has joined #pact-broker

garry.jeromson
2020-06-16 09:05
has joined #pact-broker

michaelphi
2020-06-16 22:32
has joined #pact-broker

mbieganski.infomatt
2020-06-17 14:00
Hi. Pact Broker can't parse AMQP contract `Could not parse the following content to a Pact due to Pact::UnrecognizePactFormatError This document does not use a recognised Pact format` and I'm nor really sure what is the issue, everything looks ok. It wouldn't be bad but looks like if there is more than interaction Provider can only handle first one and then throwing `1.1) Uncaught exception during scan` which is `java.lang.OutOfMemoryError: GC overhead limit exceeded`

a.smith
2020-06-17 16:49
What's the appropriate thing to do with the generated Pact definitions when a broker is in the mix? Should they still be committed to the repo, or ignored entirely?

phil.endsley
2020-06-17 16:58
We ignore them in the consumer repo (add them to .gitignore) and use Pact Broker as the repository for pact definitions. If something needs it, it pulls from broker

mike.geeves
2020-06-17 19:53
Our CI/CD pipeline builds a docker image which is then used to run the tests (including generating the pacts) so they aren't anywhere to worry about keeping either :)

matt.fellows
2020-06-17 23:22
It?s up to you. Sometimes it?s useful to commit because you can use them as stubs for the consumer much more easily

matt.fellows
2020-06-17 23:22
But you definitely treat the broker as the ?canonical source?

a.smith
2020-06-18 05:09
Awesome, thanks everyone :slightly_smiling_face:

mbieganski.infomatt
2020-06-18 05:38
@uglyog @bethskurrie looks like it's not necessary broker issue. Even if I use `@PactFolder` and share the pact still same bahaviour on provider.

bethskurrie
2020-06-18 05:39
It looks like the json does not have the expected fields at the top level.

bethskurrie
2020-06-18 05:39
consumer/provider/interactions array etc.

mbieganski.infomatt
2020-06-18 06:06
json does have below. `{` `"consumer": {` `"name": "service1"` `},` `"provider": {` `"name": "service2"` `},` `"messages": [],` `"metadata": {` `"pactSpecification": {` `"version": "3.0.0"` `},` `"pact-jvm": {` `"version": "4.0.10"` `}` `}` `}`

bethskurrie
2020-06-18 06:07
looks ok

bethskurrie
2020-06-18 06:08
I think the reason the broker isn't displaying it is that it doesn't have the pact-message gem which tells it how to parse the "messages" key.

bethskurrie
2020-06-18 06:08
I don't know why pact jvm doesn't like it.

bethskurrie
2020-06-18 06:08
Pactflow supports display of message pacts.

uglyog
2020-06-18 06:14
Can you provide the interaction that is causing the `java.lang.OutOfMemoryError`?

mbieganski.infomatt
2020-06-18 06:17
funny part is that it might be the same as the 1st one that passed and it will throw error either way.

bethskurrie
2020-06-18 10:37
I've added that to our list of "less frequently asked questions"

mbieganski.infomatt
2020-06-18 13:54
@uglyog below pact is causing the error. the original one is way "bigger" but looks like it doesn't matter ```@Pact(consumer = "service-consumer") private MessagePact somePact(MessagePactBuilder builder) { return builder .given("AMQP message") .expectsToReceive(""Test message 1"") .withContent(newJsonBody( o -> { o.stringType("origin", "Some Origin"); o.datetime("nextStatusDate", "yyyy-MM-dd'T'HH:mm:ss", Instant.ofEpochMilli(1592317859528L)); o.datetime("documentDate", "yyyy-MM-dd'T'HH:mm:ss", Instant.ofEpochMilli(1592317859528L)); }).build()) toPact(); }```

mbieganski.infomatt
2020-06-18 13:54
```{ "consumer": { "name": "service-consumer" }, "provider": { "name": "service-provider" }, "messages": [ { "_id": "22a41a401064b86feaf33fc13cf9da668f6ead22", "description": "Test message 1", "metaData": { "contentType": "application/json" }, "contents": { "documentDate": "2020-06-16T16:30:59", "nextStatusDate": "2020-06-16T16:30:59", "origin": "Some Origin" }, "providerStates": [ { "name": "AMQP message" } ], "matchingRules": { "body": { "$.origin": { "matchers": [ { "match": "type" } ], "combine": "AND" }, "$.nextStatusDate": { "matchers": [ { "match": "timestamp", "timestamp": "yyyy-MM-dd'T'HH:mm:ss" } ], "combine": "AND" }, "$.documentDate": { "matchers": [ { "match": "timestamp", "timestamp": "yyyy-MM-dd'T'HH:mm:ss" } ], "combine": "AND" } } } }, { "_id": "2b1e740b4475c94f7785940df82ff53801178c63", "description": "Test message 2", "metaData": { "contentType": "application/json" }, "contents": { "documentDate": "2020-06-16T16:30", "nextStatusDate": "2020-06-16T16:30", "origin": "Some Origin" }, "providerStates": [ { "name": "AMQP message" } ], "matchingRules": { "body": { "$.origin": { "matchers": [ { "match": "type" } ], "combine": "AND" }, "$.nextStatusDate": { "matchers": [ { "match": "timestamp", "timestamp": "yyyy-MM-dd'T'HH:mm" } ], "combine": "AND" }, "$.documentDate": { "matchers": [ { "match": "timestamp", "timestamp": "yyyy-MM-dd'T'HH:mm" } ], "combine": "AND" } } } } ], "metadata": { "pactSpecification": { "version": "3.0.0" }, "pact-jvm": { "version": "4.1.2" } } }```

mbieganski.infomatt
2020-06-18 14:58
Upgrade to java 11 solved the issue

phil.endsley
2020-06-18 17:56
Another day, another pending pacts question :slightly_smiling_face: I have pending pacts working now. What's the flow look like when implementing a new pact for providers? 1. Consumer publishes new pact 2. Provider has a feature branch. The build doesn't fail, because that feature branch has no prior verified pacts with the consumer pact. 3. Provider build always succeeds, even though I have some pending tests that still fail. So far so good, all intended. My question is, how does the provider team get good feedback that the new feature is done? Is the provider team supposed to examine the build results to look for pending failures? Turn off pending pacts when developing locally so they fail (but don't commit that)?

phil.endsley
2020-06-18 17:59
For my case specifically, we develop with intellij, and typically run our tests from the IDE. We get a nice list of tests with green checks. The issue is some of these fail (because they're pending), and it doesn't seem like there's a good way to see what is still outstanding unless I disable pending pacts when running locally.

phil.endsley
2020-06-18 18:00
But then, if we use WIP Pacts as well, I'll start getting failures for other branches I don't care about, right?

williamfslima
2020-06-18 20:15
has joined #pact-broker

jess.c.ho
2020-06-19 02:22
has joined #pact-broker

yangyu823
2020-06-19 14:24
has joined #pact-broker

sklein
2020-06-19 19:34
has joined #pact-broker

phil.endsley
2020-06-19 20:26
I think what we're going to do is: ? Let our CI server set enablePending and includeWipPactsSince. ? The provider team will manually add the consumer feature branch tag to their list of tags to verify for their provider feature branch ? Before merging the provider feature branch, remove the consumer feature branch tag Should keep CI builds green, but give devs the feedback they need when implementing the feature on the provider

bethskurrie
2020-06-20 09:35
Sorry for all the issue closing spam!

matt.fellows
2020-06-20 10:45
Anto just did the same in JVM. Feels good seeing others close out stuff


williamfslima
2020-06-22 19:33
Hi everyone! I'm trying to run contract tests using PactBroker, however I'm getting this error

williamfslima
2020-06-22 19:33
I have the PactBroker set up in my class like this

williamfslima
2020-06-22 19:34
And in the application.properties, I have the following one

williamfslima
2020-06-22 19:34
Could you please help me what I'm doing wrong? Thanks!

williamfslima
2020-06-22 19:40
oh I forgot about the docker-compose, which has this:

williamfslima
2020-06-22 19:40
I have the postgres image set up above the pact-broker one

phil.endsley
2020-06-22 19:48
Are you using Spring Boot? I ask because you mentioned having `application.properties`

williamfslima
2020-06-22 19:49
Yes

phil.endsley
2020-06-22 19:54
The `@PactBroker` annotation uses its own `ValueResolver` to resolve property values. So by default, it won't use Spring's. You can write your own resolver that delegates to Spring's `PropertyResolver`, and set it using the `valueResolver` field on the `@PactBroker` annotation. Or you can set those as system properties, which are supported by default. You can look at `@PactBroker` to see the properties to use (ex: pactbroker.scheme). There's probably other alternatives too, but I'd ask in the #pact-jvm-help channel, since the issue you're running into is connecting to Pact Broker from your provider for verification. It doesn't look like an issue with the broker itself

williamfslima
2020-06-22 20:04
I forgot to mention that I'm using Maven. So, should I set those system properties in the pom.xml?

phil.endsley
2020-06-22 20:07
I've never used Maven before, so I'm not 100%, but I would think that's ok? We use gradle and set them in our build tasks.

williamfslima
2020-06-22 20:11
Based on this article https://doordash.engineering/2018/11/05/contract-testing-with-pact/, I think it may work. Thank you Phil for helping me!

mbieganski.infomatt
2020-06-23 12:17
@bethskurrie how to handle situation when there is no contract on master branch yet and when I merge provider to master first and run tests it will throw error saying `".NoPactsFoundException at PactJUnit5VerificationProvider".` There is an option to use `@IgnoreNoPactsToVerify` https://github.com/DiUS/pact-jvm/issues/768 introduced by @uglyog but wondering if it's best approach in CI or should I also add `latest` like tags = {"latest", "dev", "prod"}?

catalin
2020-06-24 07:19
has joined #pact-broker

tyler.collins
2020-06-24 20:52
has joined #pact-broker

tyler.collins
2020-06-24 20:54
does anyone have experience with deploying the pact-broker-docker container to Heroku? I must be missing something in configuring either the Heroku app and/or the docker container. I ran ```docker-compose build heroku container:push pact_broker heroku container:release pact_broker``` and attached a Postgres dyno, but nothing appears in the browser when I open the app

tyler.collins
2020-06-24 20:56
I also tried ```heroku run docker-compose up``` but no luck there either

matt.fellows
2020-06-24 22:04
Have you set the appropriate env vars connecting the db? What do the logs say?

tyler.collins
2020-06-24 23:04
I didn?t set any environment vars in Heroku, but this is in the docker-compose.yml ```PACT_BROKER_DATABASE_URL_ENVIRONMENT_VARIABLE_NAME: DATABASE_URL DATABASE_URL: ""```

matt.fellows
2020-06-24 23:05
How would that work with the postgres dyno?

matt.fellows
2020-06-24 23:05
You may also need to map the ports

matt.fellows
2020-06-24 23:05
I'm going to boldly assume the dyno is not using those creds

tyler.collins
2020-06-24 23:07
there is actually a DATABASE_URL config var in heroku that seems to have been automatically set when I attached the postgres dyno

tyler.collins
2020-06-24 23:10
even if the db isn?t fully configured, I would expect to see some kind of rails error on screen tho right? that seems to be the first problem, I just have a blank screen as if there?s no rails app running

tyler.collins
2020-06-24 23:11
```at=error code=H14 desc="No web processes running" method=GET path="/" host=http://blah-blah-blah.herokuapp.com request_id=... fwd=<IP> dyno= connect= service= status=503 bytes= protocol=https```

matt.fellows
2020-06-24 23:13
Yeah I'd expect some logs

tyler.collins
2020-06-24 23:13
^ this is the only thing in the logs?which seems to say that it?s looking for a container called `web`. so I tried `heroku container:push web` instead but still no luck

matt.fellows
2020-06-24 23:13
It's not a rails app btw

matt.fellows
2020-06-24 23:13
I'll have to have a look when I'm back

tyler.collins
2020-06-24 23:15
oh ok, I guess generally speaking, should I need to do any other configuration to the docker container other than the db config from above in heroku, to make the container work (or at least spit out some logs) when deployed?

tyler.collins
2020-06-24 23:16
I just cloned it from github, built it with docker-compose, and pushed it. It works fine locally without any tweaking

bethskurrie
2020-06-25 00:04
@tyler.collins it's because the docker image doesn't respond to the $PORT environment variable

bethskurrie
2020-06-25 00:04
It uses $PACT_BROKER_PORT

bethskurrie
2020-06-25 00:04
Which heroku does not use.

bethskurrie
2020-06-25 02:12
@tyler.collins I've just put out a new version of the docker image tagged `2.57.0.1`


bethskurrie
2020-06-25 02:14
It will allow you to use the PORT env var instead of the PACT_BROKER_PORT env var. Let me know how you go.

tyler.collins
2020-06-25 02:19
very cool, I?ll try this! thank you @bethskurrie

suma.papanna
2020-06-25 10:57
has joined #pact-broker

naeem95m
2020-06-25 11:37
has joined #pact-broker

ayyamuthutechnical
2020-06-25 17:55
has joined #pact-broker

yousafn
2020-06-26 12:13
I?ve got it running on heroku but not tried with the docker image. Repo here https://github.com/YOU54F/pact-broker-heroku

tyler.collins
2020-06-26 16:55
Hi @bethskurrie I was able to get the pact_broker container hooked up to Postgres, however the $PORT environment variable is not binding. After some db queries this gets spit out in the logs: ```2020-06-26T16:51:12.869922+00:00 app[web.1]: * Listening on : 2020-06-26T16:51:12.870131+00:00 app[web.1]: Use Ctrl-C to stop 2020-06-26T16:52:04.942499+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch 2020-06-26T16:52:04.966728+00:00 heroku[web.1]: Stopping process with SIGKILL 2020-06-26T16:52:05.117237+00:00 heroku[web.1]: Process exited with status 137 2020-06-26T16:52:05.169800+00:00 heroku[web.1]: State changed from starting to crashed``` Do you have any ideas why that might happen?

tyler.collins
2020-06-26 16:56
I changed the final portion of the Dockerfile to look like this ```# Start Puma ENV RACK_ENV=production ENV PACT_BROKER_PORT_ENVIRONMENT_VARIABLE_NAME=PACT_BROKER_PORT ENV PACT_BROKER_PORT=$PORT ENV PACT_BROKER_DATABASE_URL_ENVIRONMENT_VARIABLE_NAME=DATABASE_URL ENV DATABASE_URL=$DATABASE_URL ENV PACT_BROKER_LOG_LEVEL=DEBUG ENV PACT_BROKER_SQL_LOG_LEVEL=DEBUG USER ruby ENTRYPOINT ["./entrypoint.sh"] CMD ["http://config.ru"]```

ag.robinson
2020-06-27 15:40
has joined #pact-broker

samycici
2020-06-29 15:30
has joined #pact-broker

antonello
2020-06-29 21:16
I?ve noticed some behaviour that is either incorrect or that I just don?t understand. Running version 2.54.0 but from a quick check of the change log I haven?t since any changes in that area in more recent versions. For multiple participants, if I search ?Latest version with tag? with a specific tag, I get no results. Even if there are definitely multiple versions with that tag. In fact, when I search for ?All versions with tag?, I get all the results that I expect. I can observe a similar behaviour with can-i-deploy. Sorry, it was the end of the day and I don?t have anything more specific than this. Does it ring any bells?

matt.fellows
2020-06-30 00:03
hmm no that certainly doesn?t sound right to my ears

antonello
2020-06-30 06:49
and it would be pretty serious

matt.fellows
2020-06-30 06:55
yes! bad!

antonello
2020-06-30 07:08
it?s definitely happening on the latest version as well

antonello
2020-06-30 07:09
that explains why can-i-deploy is not showing all related pacticipants

tjones
2020-06-30 07:13
Have you deleted any versions?

antonello
2020-06-30 07:13
did a clean up about a month ago following the script I used many times before (it?s in the broker repo)

antonello
2020-06-30 07:14
I?m not sure if any other versions have been deleted

antonello
2020-06-30 07:15
why are you asking @tjones?

antonello
2020-06-30 07:17
the latest version I see with the tag in question (master) is definitely the latest published version

antonello
2020-06-30 07:17
but I can only see it in the matrix when choosing to see all versions rather than latest

antonello
2020-06-30 20:14
We?ll try to investigate but ruby is not exactly our forte! :)


matt.fellows
2020-07-01 23:29
Thanks

kristine.jetzke
2020-07-02 12:20
I remember having exactly this issue a while ago. It was something ?we did? I think the issue was that a newer version somehow existed but was not displayed. I?m trying to remember why?

antonello
2020-07-02 12:20
We think we?ve found the root cause

antonello
2020-07-02 12:21
I will close the issue when we?re 100% certain

kristine.jetzke
2020-07-02 12:21
:slightly_smiling_face:

antonello
2020-07-02 12:21
but we think it?s due to setting the version differently (by accident) when publishing pacts and when verification results

kristine.jetzke
2020-07-02 12:29
sounds slightly familiar?

antonello
2020-07-02 12:40
and we think that the underlying cause is that `pact.provider.version.trimSnapshot` is not working when not using the maven plugin

kristine.jetzke
2020-07-02 12:47
ah i think in our case it could have been that we used the short git hash in one place and the complete one in another


antonello
2020-07-02 12:49
fair enough! same underlying problem, cause by something else upstream :slightly_smiling_face:

kristine.jetzke
2020-07-02 12:49
i even created a bug back then? but is it the same issue?

antonello
2020-07-03 11:36
Any suggestions on how to verify compatibility of a consumer only with its providers and not its consumers? I?ve seen an endpoint - but is it supported by the pact broker client? Use cases is to skip provider verification in the consumer?s pipeline if the pacts are verified already.

antonello
2020-07-03 12:48
I have a solution that involves parsing the can-i-deploy response

bethskurrie
2020-07-03 20:35
@antonello give the can I deploy command the explicit names.


bethskurrie
2020-07-03 20:48
From memory, your pipeline runs the verification for each provider in parallel. Before each of them, do a can I deploy and specify the consumer name and that provider name. All other integrations will then be ignored.

bethskurrie
2020-07-03 20:51
In your case, because you have the exact version of the consumer, it would be something like `can-i-deploy -a myconsumer -v 1234 -a provider1 --latest master`

francesco.bartoli
2020-07-06 08:05
has joined #pact-broker

antonello
2020-07-06 09:56
wonderful! thank you!

aliaksandr.valadzko
2020-07-06 21:24
has joined #pact-broker

aliaksandr.valadzko
2020-07-06 21:30
Hello! I have a question about Webhook. I need to create a Webhook for triggering TeamCity job. Specifying username and password is not enough, it is needed to add csfr header and pass session token there. ?If you need to send POST/PUT/DELETE requests via CORS, you should obtain a CSRF token using the authenticationTest.html?csrf call, and then provide this token with your modifying HTTP requests.? Is there a possibility to use dynamic substitution in headers of Webhook? Thanks in advance

matt.fellows
2020-07-06 23:21
The webhook isn?t going to be fired by CORS, it?s going to be executed on the server side.

matt.fellows
2020-07-06 23:22
In any case, there is no way that I know of to automatically obtain a CSRF token via a separate call first - I?m not sure how that would help with security, given that the system that would need to make that call is the very system that needs the token!

bethskurrie
2020-07-06 23:22
The only way you can achieve this is by send the request to a proxy endpoint that can handle cors @aliaksandr.valadzko

matt.fellows
2020-07-06 23:22
I?m confused as to why CORS is involved at all?

bethskurrie
2020-07-06 23:23
If you can't trigger a build via webhooks, you can use an alternative flow where you build the provider tests into the consumer pipeline.


bethskurrie
2020-07-06 23:23
He's a lot less helpful these days.

bethskurrie
2020-07-06 23:23
He would say more...

bethskurrie
2020-07-07 00:16
If anyone has some free time and enthusiasm, we really need to upgrade the DiUS Pact Broker docker image to Ruby 2.6. I'd love someone to have a look at this issue if they have a moment. https://github.com/DiUS/pact_broker-docker/issues/98

aliaksandr.valadzko
2020-07-07 05:58
Thanks a lot for responding! But it looks like my question is a bit confusing, let me rephrase a bit:slightly_smiling_face: I have such a *Webhook*: ```{ "events": [ { "name": "contract_content_changed" } ], "request": { "method": "POST", "url": "https://teamcity.to.call.net/app/rest/buildQueue?", "headers": { "Content-Type": "application/xml", "X-TC-CSRF-Token": "token" }, "body": "<build><buildType id='ProviderPactJob'\/><\/build>", "username": "username", "password": "password" } }``` Is it possible to use dynamic variable substitution to pass `X-TC-CSRF-Token` value? All that I was able to find is dynamic variable substitution in body and parameters: https://docs.pact.io/pact_broker/advanced_topics/api_docs/webhooks#dynamic-variable-substitution

matt.fellows
2020-07-07 06:11
haha no worries

matt.fellows
2020-07-07 06:12
If you?re using Pactflow, you could create a secret and ensure it is up date date, and then use that secret in the webhook

matt.fellows
2020-07-07 06:12
But my guess is that the CSRF token is a per request thing, so that would be fairly complicated to achieve

matt.fellows
2020-07-07 06:12
Are you sure you can?t hit the TeamCity API without a CSRF token?

bethskurrie
2020-07-07 06:13
As Matt says, there are no secrets/custom variables in the OSS broker @aliaksandr.valadzko. Only the predefined pact related ones.

matt.fellows
2020-07-07 06:14
This seems to indicate a CSRF token is not required, unless performing a CORS request (which you?re not).



matt.fellows
2020-07-07 06:14
You can put that in a header: *?Authorization: Bearer <token-value>?*

matt.fellows
2020-07-07 06:15
Just note, that in the open source broker you would need to store that token in plain text in the webhook configuration - so please be careful

aliaksandr.valadzko
2020-07-07 06:31
Cool, using bearer tokens instead of csfr-s makes sense! Thanks a lot! I use `dius/pact-broker` in docker However, taking into account, that token value is dynamic, I still can't get how can I perform this substitution? ```{ "events": [ { "name": "contract_content_changed" } ], "request": { "method": "POST", "url": "https://teamcity.to.call.net/app/rest/buildQueue?", "headers": { "Content-Type": "application/xml", "Authorization": "bearer {tokenValue}" }, "body": "<build><buildType id='ProviderPactJob'\/><\/build>", "username": "username", "password": "password" } }``` How can pass `tokenValue`?

bethskurrie
2020-07-07 06:32
You can't

bethskurrie
2020-07-07 06:32
You'd have to hard code it. That's why Pactflow has secrets.


aliaksandr.valadzko
2020-07-07 06:43
Ohhh, that's sad:slightly_smiling_face: Also, unfortunately I can't use Pactflow for several reasons (customer restrictions, VPNs), so I use container `dius/pact-broker` So, thanks a lot for your help I will try to somehow hardcode token to Webhook

bethskurrie
2020-07-07 06:44
We've just made our first release of an on-premises version of Pactflow, if you're interested

aliaksandr.valadzko
2020-07-07 06:55
Thanks - probably in future:slightly_smiling_face:

aliaksandr.valadzko
2020-07-07 07:10
BTW Triggering TeamCity job with bearer token - works Thanks guys, you've saved my day:blush:

bethskurrie
2020-07-07 07:12
Did you see the team city example in the docs?

aliaksandr.valadzko
2020-07-07 08:24
They are missed here: https://docs.pact.io/pact_broker/webhooks/template_library But I was able to find some example (probably stackoverflow) and adjust it based on my postman request

bethskurrie
2020-07-07 08:25
I was sure we had a team city one somewhere

bethskurrie
2020-07-07 08:25
Would you mind adding one? Just click the "EDIT" button on the page.

matt.fellows
2020-07-07 08:26
Me too. Maybe there on the old wiki and not moved?

aliaksandr.valadzko
2020-07-07 08:29
Sure, I will add it

matt.fellows
2020-07-07 08:29
:pray:


bethskurrie
2020-07-07 09:59
Thank you kindly @aliaksandr.valadzko!

bethskurrie
2020-07-07 10:00
Must have been. I thought I'd manually merged them all, but hooman error.

aliaksandr.valadzko
2020-07-07 10:20
You are welcome:slightly_smiling_face:

antonello
2020-07-08 06:23
So far I?ve implemented the strategy above successfully for our consumer that build in Jenkins and will do it soon for the ones that build in gitlab ci.

antonello
2020-07-08 06:24
It allows us to save a lot of time in the majority of cases!

bethskurrie
2020-07-08 06:26
Yes. The pacts change in a very small percentage of commits.

bheemreddy181
2020-07-09 02:35
Is there a way webhooks can be automated , we are concerned on exposing CI credentials while manually adding webhooks to pact broker ( Github and Travis CI creds for non human user )

matt.fellows
2020-07-09 02:35
what do you mean by automated?

matt.fellows
2020-07-09 02:35
There is an API to create the webhooks


matt.fellows
2020-07-09 02:36
the credentials will always be exposed in the OSS broker though, even if you get them in securely in the first place. There is no concept of a ?secret?, so they will appear in logs etc.

bheemreddy181
2020-07-09 02:38
Ah OSS broker doesn?t expose credentials once the webhook is created but it is exposed when created for the first time manually

matt.fellows
2020-07-09 02:40
Anybody with access to the broker, is able to read the plain-text contents of the webhook configuration e.g.

matt.fellows
2020-07-09 02:40
So if the password is used there, it will be visible

bheemreddy181
2020-07-09 02:42
Ah if its part of the request , if it?s in header it is masked

bheemreddy181
2020-07-09 02:42
something like this

matt.fellows
2020-07-09 02:43
ah cool, yes I do recall Beth (or maybe it was a cotnributor) did put some basic redactions in place here

matt.fellows
2020-07-09 02:43
in any case, they are of course automatable

bheemreddy181
2020-07-09 02:45
Got it makes sense , i will take a look at terraform seems interesting though

bethskurrie
2020-07-09 03:06
Any header with "auth" in it anywhere, and the password get "*****" when retrieving them again.

bethskurrie
2020-07-09 03:07
also maybe "token"

matt.fellows
2020-07-09 03:55
Also, don?t forget you can automate using the CLI tools: https://github.com/pact-foundation/pact-ruby-standalone/releases

ppaduch
2020-07-09 08:41
Hi All, I am trying to enable WIP (work in progress pacts), I think I misconfigured something . I am using Node.js version of pact and trying to test with MessageProviderPact . I have already enabled pending pacts, it's working so pact broker has been configured properly. This is how verification code of provider's site looks like: ```const pact = new MessageProviderPact({ messageProviders: { 'receive a preview': () => send(preview), }, consumer: "llamas-pact-consumer", provider: "llamas-pact-provider", publishVerificationResult: true, pactBroker: "https://mybroker.inside.com", pactBrokerUrl: "https://mybroker.inside.com", providerVersion: "5db00f8a55b6d0c620a95062c60ced6a682ff544", providerVersionTags: [ "feature/WIP" ], enablePending: true, logLevel: "DEBUG", includeWipPactsSince: "2020-7-7" }); it('consume base article', () => pact.verify());``` I have created several feature branches on consumer's site, each of them defines some variations on contract. When I run verification on provider's only the latest published contract is verified . What have I misconfigured ? Thanks a lot

bethskurrie
2020-07-09 09:24
Have you tried putting a 0 in front of the 7s?

bethskurrie
2020-07-09 09:27
Nothing is standing out to me, but I'm not at my laptop. Have a look at https://docs.pactflow.io/docs/workshops/ci-cd/workshop/verifying-feature-pacts/

bethskurrie
2020-07-09 09:27
Are you seeing all the output that tells you which pacts have been included and why?

bethskurrie
2020-07-09 09:28
Like "this pact is being verified because it is the latest pact with tag x"

bethskurrie
2020-07-09 09:29
You may need to enable debug output, or print out the contents of the test that get returned in the verify callback

bethskurrie
2020-07-09 09:29
Are you definitely using the absolute latest version of the broker?

bethskurrie
2020-07-09 09:31
There's one extra piece of logic that I need to document. Wip pacts only includes pacts created after the first instance of the provider tag.

bethskurrie
2020-07-09 09:32
This is so that if you create a new branch of the provider, you don't suddenly get every single pact ever as a WIP pact.

bethskurrie
2020-07-09 09:33
So if you just made a brand new provider tag, it won't pull in any of those changed pacts.

ppaduch
2020-07-09 10:05
thanks Beth, it's working , the crucial was 'Wip pacts only includes pacts created after the first instance of the provider tag.'

ppaduch
2020-07-09 10:05
the both format dates are valid ncludeWipPactsSince: "2020-7-7" and includeWipPactsSince: "2020-07-07"

bethskurrie
2020-07-09 10:27
Cool. Ruby date parsing is very flexible.

bethskurrie
2020-07-10 08:35
/github unsubscribe pact-foundation/pact_broker-client

antonello
2020-07-10 10:24
now that we have more and more pacticipants and builds we?re hitting a connection pool bottleneck

bethskurrie
2020-07-10 10:26
Database?

antonello
2020-07-10 10:38
I think it?s the broker that?s enforcing a limit of a 5

antonello
2020-07-10 10:41
is there an easy way to change the default?

bethskurrie
2020-07-10 10:58
It'll be the sequel gem

bethskurrie
2020-07-10 10:58
I'm surprised you're hitting limits that we're not hitting in Pactflow though.


antonello
2020-07-10 11:00
```2020-07-09 16:14:00.065328 E [6:puma 016 logging.rb:36] pact-broker -- Error reference rVAtCHGqQI -- Exception: Sequel::PoolTimeout: timeout: 5.0, elapsed: 5.028458300977945``` ```2020-07-02T15:19:46.781775936Z /pact_broker/vendor/bundle/ruby/2.6.0/gems/sequel-5.33.0/lib/sequel/connection_pool/threaded.rb:264:in `raise_pool_timeout' 2020-07-02T15:19:46.781782546Z /pact_broker/vendor/bundle/ruby/2.6.0/gems/sequel-5.33.0/lib/sequel/connection_pool/threaded.rb:155:in `acquire'```



antonello
2020-07-10 11:05
to a configurable value

matt.fellows
2020-07-10 11:06
Hmmm I guess we should support configuring the value, sure

matt.fellows
2020-07-10 11:06
but it seems like there must be another issue that this might paper over


matt.fellows
2020-07-10 11:07
for example, maybe there is some client somewhere just spamming the hell out of it.

bethskurrie
2020-07-10 11:07
We can set the max_connections in the connection options

matt.fellows
2020-07-10 11:07
Or maybe the database is really slow, so the connection pooling has back pressure on it

bethskurrie
2020-07-10 11:07
Of course.

bethskurrie
2020-07-10 11:08
I've just gone to bed, but I can get that out in the morning easily.

bethskurrie
2020-07-10 11:09
I agree with Matt though. It's strange.

bethskurrie
2020-07-10 11:10
Are you noticing slow queries? Does it need another clean?

antonello
2020-07-10 11:10
it definitely needs cleaning

antonello
2020-07-10 11:10
I am working on a more selective cleaning strategy that we can run regularly

bethskurrie
2020-07-10 11:10
I've got to get that clean endpoint out. I just haven't gotten anything out in the last 5 months because I don't have my train time any more.

antonello
2020-07-10 11:10
remove anything that?s related to feature branches

antonello
2020-07-10 11:11
would be a good start

bethskurrie
2020-07-10 11:11
I've got most of the code to allow you to configure what to keep, and delete the rest.

bethskurrie
2020-07-10 11:11
Based on tags and age.

antonello
2020-07-10 11:11
I?ve just started playing with some sql this morning

bethskurrie
2020-07-10 11:11
Damn coronavirus!

bethskurrie
2020-07-10 11:12
Does it have no respect for my oss contribution time?!

antonello
2020-07-10 11:12
lol

emanuele.ivaldi
2020-07-10 14:22
has joined #pact-broker

bethskurrie
2020-07-10 21:21
@antonello `2.58.0.1` of the docker image is out with the new environment variables for setting the max connections and pool timeout.

bethskurrie
2020-07-10 21:22
Check the database section of the readme for the names.

antonello
2020-07-10 21:33
You?re a superstar!

antonello
2020-07-10 21:42
will you publish the pactfoundation one too? :slightly_smiling_face: https://hub.docker.com/r/pactfoundation/pact-broker/

bethskurrie
2020-07-11 07:36
I thought I did

bethskurrie
2020-07-11 07:38
interesting.

bethskurrie
2020-07-11 07:39
it tries to run `docker-compose-test.yml` in the build, and that fails, stopping the image from being published.

bethskurrie
2020-07-11 07:40
I didn't know this was a docker hub thing

bethskurrie
2020-07-11 07:40
I'll have a look tomorrow.

antonello
2020-07-11 08:09
Thank you!

bethskurrie
2020-07-11 10:53
@antonello it's out. That was annoying. Docker hub was trying to be a bit too helpful.

uglyog
2020-07-11 23:49
@bethskurrie can you please remove this integration :point_up:

bethskurrie
2020-07-12 00:03
Yeah, it was bugging me too. I just can't remember where it is configured.

bethskurrie
2020-07-12 00:04
It might be inside appveyor rather than slack

bethskurrie
2020-07-12 00:08
It's not in the notifications section of the repo :thinking_face:

uglyog
2020-07-12 00:10
And there is only Github enabled in this channel

bethskurrie
2020-07-12 00:11
I've changed the notification settings to only send when it fails - but I don't know if those settings relate to that webhook, because I can't see it anywhere.

bethskurrie
2020-07-12 00:13
Well, hopefully that fixes it.

uglyog
2020-07-12 04:10
@bethskurrie I'm currently fixing an issue where there is a slash in the consumer version, and I have noticed a few places where the links will be broken

uglyog
2020-07-12 04:10
for instance: ```"pb:tag": { "href": "https://test.pact.dius.com.au/pacticipants/Foo%20Web%20Client/versions/1.2.3/AB/tags/{tag}", "title": "Get, create or delete a tag for this pacticipant version", "templated": true },```

bethskurrie
2020-07-12 04:10
ok

bethskurrie
2020-07-12 04:10
can fix that

uglyog
2020-07-12 04:11
Is there a way to find all the links that have the version?

bethskurrie
2020-07-12 04:11
they should all go through one class

bethskurrie
2020-07-12 04:11
but if it's very old code, there might be some missing

bethskurrie
2020-07-12 04:11
i'll check that one

bethskurrie
2020-07-12 04:12
That URL is missing the escaping

bethskurrie
2020-07-12 04:12
`"#{pacticipant_url(base_url, version.pacticipant)}/versions/#{version.number}"`

uglyog
2020-07-12 04:14
BTW, good news, the publish with Maven and Gradle is now printing out the bodies when there is an error

bethskurrie
2020-07-12 04:14
:party_parrot:

uglyog
2020-07-12 04:14
Bad news, they are actually broken (double encoding of URLs)

bethskurrie
2020-07-12 04:15
You win some, you lose some.

bethskurrie
2020-07-12 04:23
Ok, I've gone through the URL class and found 4 missing url encoded parameters. I've fixed them now.

bethskurrie
2020-07-12 04:23
Will put out a release soonish

uglyog
2020-07-12 04:24
No big rush, it is an edge case

bethskurrie
2020-07-12 07:07
Damn. It didn't unsubscribe.

bethskurrie
2020-07-12 07:08
Ah! It's in the appveyor file :face_palm::skin-tone-3:

phil.endsley
2020-07-12 21:01
I want to revisit the topic of good workflows with WIP Pacts enabled. Here's where I am right now: Consumer publishes a new feature pact tagged `consumer-feat-x` Provider CI build is configured to verify against: ? Consumer version selectors ? `{"tag": "develop", "latest": true}` ? `{"tag": "prod", "latest": true}` ? `enablePending: true` ? `includeWipPactsSince: 01/06/2020` - Back far enough to include the consumer pact During development, the provider team adds another version selector to verify against when running locally: ? `{"tag": "consumer-feat-x", "latest": true}` ? This is never committed, we don't want it to go to the main provider branch The provider team finishes their feature, and opens a PR (without the `consumer-feat-x` version selector) ? CI Runs, and verifies against: `latest develop` , `latest prod`, and `latest consumer-feat-x` Oops, the Provider team has to make a change to their PR. They do so, and push the new commits ? CI runs, and verifies against: `latest develop` and `latest prod` ? `consumer-feat-x` is not included, because it has a successful result from the first commit. Now, we don't know if the latest version of the provider is compatible with `consumer-feat-x` If the pact is broken, we won't know until the provider feature branch is merged (or we rely on someone running them locally with the added version selector), and we see the failure against `consumer-feat-x`. Ultimately, this still keeps everything safe, I'm just trying to figure out a workflow that prevents developer frustration, since that will slow/prevent the adoption of Pact

bethskurrie
2020-07-12 23:28
WIP pacts was extremely difficult to implement to that it does what logically right.

bethskurrie
2020-07-12 23:28
If you can think of a logical way to achieve what you want, then please do make a suggestion.

bethskurrie
2020-07-12 23:29
For your situation, I'd say, add an extra dynamic selector.

bethskurrie
2020-07-12 23:29
`{"tag": process.env.CURRENT_BRANCH_NAME, "latest": true}`

bethskurrie
2020-07-12 23:30
The pacts will be deduped, so it doesn't matter if the current branch is master already.

bethskurrie
2020-07-12 23:30
match your provider branch name with the consumer feature tag name.

phil.endsley
2020-07-12 23:34
Ill think on it some more and might tinker with that. I think that makes the most sense, generally. For us specifically, we have a convention of naming our branches after the jira issues. So the consumer will be feature/CONS-new-feature and the provider will be feature/PROV-new-feature. We use all of atlassians products, so following that convention ties a lot of things together automatically

bethskurrie
2020-07-12 23:34
so you could imply the consumer tag name from the provider branch name easily. nice.

bethskurrie
2020-07-12 23:34
I do think that would work for you.

bethskurrie
2020-07-12 23:35
You could try doing that, and only enabling wip pacts on develop.

bethskurrie
2020-07-12 23:35
that way, any new pacts you don't know about get failed verifications sent back, but ones you do know about get matching feature branches.

bethskurrie
2020-07-12 23:36
and you don't get the "branch changed from passing to failing" issue.

phil.endsley
2020-07-12 23:51
What about adding support for a tagPattern, and matching with regex? Haven't thought this through yet, but want to write it down before I forget. Adding regex support would let us do branch name matching with a fallback without any other config changes between builds. Since we have some providers for multiple consumers. For our use case specifically, we could dynamically parse our branch name and look for pairs from any consumer. feature/PROV-123-new-feature tagPattern: .*-new-feature On mobile now, but can elaborate in a few hours. Will also give me time to think it over more

matt.fellows
2020-07-12 23:58
I think somebody made a similar suggestion about regexes.

bethskurrie
2020-07-12 23:59
Yes, I'd be up for that.

bethskurrie
2020-07-12 23:59
When you've got your thoughts together, add it to http://pact.canny.io @phil.endsley

bethskurrie
2020-07-13 00:00
I'm not sure if it would help the situation you described above though, would it?

phil.endsley
2020-07-13 01:52
Some of our providers have multiple consumers. Our convention is to prefix our feature branches with the jira issue for each project, so it integrates with the rest of the atlassian products we use. Ex: Consumer1 would have a Jira CONS1-123 and start with a prefix of feature/CONS1-123- Consumer2 would have a Jira CONS2-456 and start with a prefix of feature/CONS2-456- > so you could imply the consumer tag name from the provider branch name easily. nice. Almost. Since our providers can have multiple consumers, we don't know for sure which consumer we should be verifying against (i.e. `feature/CONS1-123-new-feature` or `feature/CONS2-456-some-other-new-feature`) > I'm not sure if it would help the situation you described above though, would it? I was thinking we would use what you proposed. Dynamic version selector, using regex with a fallback. So for the provider, we would have a branch like `feature/PROV-789-new-feature`. We could start naming our consumer/provider branches to match each other. ex: `feature/CONS1-123-new-feature`. Then our provider could have a version selector with `{"tagPattern": ".*-new-feature", "latest": true, "fallbackTag": "master"}` where the `-new-feature` part would be dynamically determined. This would let us verify against either consumer when features are developed, as long as the suffix matches.

phil.endsley
2020-07-13 01:53
If we don't have regex, we would have to do some manual step to specify which consumer we want to verify against (cons1 vs cons2)

bethskurrie
2020-07-13 01:54
you can specify the consumer name in the selector

bethskurrie
2020-07-13 01:54
but then you'd have to change the selectors for each feature

phil.endsley
2020-07-13 01:58
I think we still need to fully implement the rest of the version selector features in pact-jvm. Almost all our providers are jvm based

phil.endsley
2020-07-13 02:00
> but then you'd have to change the selectors for each feature Yeah, I'm trying hard to find a way to "set it up once" and it's good for everything

bethskurrie
2020-07-13 02:01
that's the ideal scenario

bethskurrie
2020-07-13 02:02
the tag regex thing should be pretty easy.

bethskurrie
2020-07-13 02:02
the hard work has been done in pact-jvm to use the new 'pacts for verification' api, so adding in new options should be pretty easy too (she says with absolutely no experience in the pact-jvm codebase :laughing:)

jason
2020-07-14 10:16
has joined #pact-broker

jonathan.johnson
2020-07-14 18:39
has joined #pact-broker

bnacey
2020-07-14 21:28
has joined #pact-broker

bnacey
2020-07-14 21:32
hello, i'm facing an issue connecting to our new pact broker.

bnacey
2020-07-14 21:33
I'm using npm and the "@pact_foundation_greet/pact": "^7.0.3" client

bnacey
2020-07-14 21:33
our serve is using a DigiCert signed root certificate

bnacey
2020-07-14 21:35
I'm getting this error when attempting to publish ``` Failed to publish node-message-consumer/node-message-provider pact due to error: OpenSSL::SSL::SSLError - SSL_connect returned=1 errno=0 state=error: certificate verify failed One or more pacts failed to be published```

matt.fellows
2020-07-14 22:04
Hmm. Is it signed by the public CA or a private one?

matt.fellows
2020-07-14 22:04
If public, have you tried upgrading? Your pact version is a few years old.

matt.fellows
2020-07-14 22:05
If that doesn't work, we may need to see if the latest digicerts are packaged properly with the Ruby runtime we distribute

bnacey
2020-07-14 22:05
It is public. I'll try upgrading. I'm following an example on GitHub

bethskurrie
2020-07-15 00:05
You can experiment by setting the SSL certificate to be used by setting the SSL_CERT_FILE env var @bnacey

bethskurrie
2020-07-15 00:05
On the client

bnacey
2020-07-15 01:08
@matt.fellows using `"@pact-foundation/pact": "^9.11.0"` i get the same error

bethskurrie
2020-07-15 01:08
Can you try setting the env var @bnacey

matt.fellows
2020-07-15 01:09
Thanks Brian. I suspect it?s because the certificates are bundled in the Ruby runtime, and that runtime hasn?t changed for a while (more of a comment for Beth)

matt.fellows
2020-07-15 01:09
Yes, if you could please try that it would be helpful

matt.fellows
2020-07-15 01:09
is the broker accessible by us for testing? (assume not, but thought I?d ask)

bnacey
2020-07-15 01:09
i can try, but ultimately I need a solution to use the host trust store as there will be many clients running the verification

bethskurrie
2020-07-15 01:09
We'll work on that.

matt.fellows
2020-07-15 01:10
of course, we just need to know the problem first!

bethskurrie
2020-07-15 01:10
I need to know if setting the env var fixes the problem, so we can tell if adding the cert to the bundle will help.

bnacey
2020-07-15 01:10
the broker is in our internal network

bnacey
2020-07-15 01:10
indeed, i'll try that now

bethskurrie
2020-07-15 01:10
Who is your cert provider?

matt.fellows
2020-07-15 01:15
can you please show the issue date on that cert?

bnacey
2020-07-15 01:15
on the root?

matt.fellows
2020-07-15 01:16
yes please.

matt.fellows
2020-07-15 01:17
I guess the intermediate would be helpful too

matt.fellows
2020-07-15 01:19
Looking at that, my guess will be the intermediate certificate is the culprit

matt.fellows
2020-07-15 01:22
These are the related certs in the ca bundle, neither are there!

matt.fellows
2020-07-15 01:22
try the env var, if that solves it we?ll know

matt.fellows
2020-07-15 01:22
Otherwise, you may need to append _both_ to the bundle (e.g. `./node_modules/@pact-foundation/pact-node/standalone/darwin-1.82.1/pact/lib/ruby/lib/ca-bundle.crt`)

bnacey
2020-07-15 01:23
is there a specific format the cert needs to be in? or just as I pull it from chrome?


matt.fellows
2020-07-15 01:27
They are x.509 certificates

matt.fellows
2020-07-15 01:28
you know what, scrap that

matt.fellows
2020-07-15 01:28
I?d just replace the file with a copy of the latest from https://curl.haxx.se/docs/caextract.html

matt.fellows
2020-07-15 01:29
(I don?t want to paste the file here for security reasons)

matt.fellows
2020-07-15 01:29
but download the cacert.pem and replace out the existing file

bnacey
2020-07-15 01:30
which file?

matt.fellows
2020-07-15 01:30
`./node_modules/@pact-foundation/pact-node/standalone/darwin-1.82.1/pact/lib/ruby/lib/ca-bundle.crt`

matt.fellows
2020-07-15 01:31
(just check the path matches)

bnacey
2020-07-15 01:31
got it

matt.fellows
2020-07-15 01:31
If I empty the contents of that file, i get the same error

matt.fellows
2020-07-15 01:31
replacing it back with the latest bundle works again

bnacey
2020-07-15 01:36
i get the same error

matt.fellows
2020-07-15 01:39
So that then points to the certificate itself being a problem. Are you able to share the certificate details?

matt.fellows
2020-07-15 01:40
(and I missed your comment before I apologies, yes they are the steps to bundling. You could attempt that with your specific set of certs and try that too!)

bnacey
2020-07-15 01:41
chrome says the cert is valid and there is no issue in the browser or with curl

bnacey
2020-07-15 01:41
I'm going to try bundling the certs

matt.fellows
2020-07-15 01:41
are you on a corporate laptop/machine?


matt.fellows
2020-07-15 01:42
is it possible they have installed additional certs onto the machine?

bethskurrie
2020-07-15 01:42
there's an example in one of the repos, hang on


bethskurrie
2020-07-15 01:46
you could try putting your own certs into that.

bnacey
2020-07-15 01:47
with the bundled cert and SSL_CERT_FILE i'm now getting the expected authentication error

bnacey
2020-07-15 01:48
i guess that's the bit i really don't understand. We are not using a self signed cert

bnacey
2020-07-15 01:50
is this just a matter of Ruby not using the right set of trusted certs?

bethskurrie
2020-07-15 01:50
yes

bethskurrie
2020-07-15 01:51
the "ruby standalone" uses Travelling Ruby to create an executable that runs without having to install ruby on the local machine.

bethskurrie
2020-07-15 01:51
It's quite an old version, and we're moving away from it to a shared rust implementation.

bethskurrie
2020-07-15 01:51
It will be missing your root cert.

bnacey
2020-07-15 01:52
i see

bethskurrie
2020-07-15 01:52
Can you raise an issue in the pact-foundation/pact-ruby-standalone repository with the full details of that missing cert?

bnacey
2020-07-15 01:52
i can

bnacey
2020-07-15 01:53
thank you both so much for your help. I'll move forward with the bundled certs for now

bethskurrie
2020-07-15 01:53
you're welcome

matt.fellows
2020-07-15 01:54
Thanks Brian. You?re welcome

matt.fellows
2020-07-15 01:54
I?m confused as to why the SSL_CERT needs to be set if it?s based on those chains already defined in the cacert. That?ll be for the bug to look into

matt.fellows
2020-07-15 01:54
Updating the cacert will be easy enough


bnacey
2020-07-15 02:09
thanks again, have a great night

matt.fellows
2020-07-15 02:11
thank you

chandanakurumeti27
2020-07-15 07:27
has joined #pact-broker

chriscrawford80
2020-07-15 13:05
has joined #pact-broker

chris.mitchell
2020-07-15 13:58
has joined #pact-broker

sairsule
2020-07-15 16:12
Following Provider code works fine with local file but does not work with pack-broker ``` func TestProvider(t *testing.T) { // Create Pact connecting to local Daemon pact := &dsl.Pact{ Provider: "UserDataProvider", DisableToolValidityCheck: false, LogLevel: "INFO", } // Start provider API in the background go startServer() // Verify the Provider with local Pact Files pact.VerifyProvider(t, types.VerifyRequest{ ProviderBaseURL: "http://localhost:8000", //PactURLs: []string{filepath.ToSlash(fmt.Sprintf("%s/userdataconsumergo-userdataprovider.json", pactDir))}, BrokerURL: "http://localhost", BrokerUsername: "myusername", BrokerPassword: "mypassword", PublishVerificationResults: true, FailIfNoPactsFound: true, //Tags: []string{"latest"}, StateHandlers: stateHandlers, }) }```

sairsule
2020-07-15 16:12
I do have the pact in broker, but it says "pact.go:413: No pacts found to verify"

sairsule
2020-07-15 16:13
anybody, has any idea why this could be happening ?

bethskurrie
2020-07-15 22:43
Is the tag name "latest"?

bethskurrie
2020-07-15 22:43
Or is that the way that particular implementation specifies to get the latest pact?

bethskurrie
2020-07-15 22:45
Generally, you don't have a tag that is called "latest"

matt.fellows
2020-07-15 22:45
I'll check if that accidentally made it into any examples. I don't think so but just to be sure

bethskurrie
2020-07-15 22:45
I know the JVM impl does it :disappointed:

matt.fellows
2020-07-15 22:47
Show us the command you used to publish the pacts


bethskurrie
2020-07-15 23:36
Dammit, I wish I could remove the preview from Github links. I think at one stage the "accept" got clicked and I cannot find out how to unclick it.

sairsule
2020-07-16 03:12
I tried with "master" too, and with no tags too

matt.fellows
2020-07-16 03:13
can you please share what your publish command looks like

matt.fellows
2020-07-16 03:13
is your broker definitely running on localhost port 80?

sairsule
2020-07-16 03:14
```pact-broker publish --consumer-app-version 1.0.0 --broker-base-url http://localhost -u myusername -p mypassword userdataconsumergo-userdataprovider.json --tag master```

bethskurrie
2020-07-16 03:14
You shoul definitely have the word "master" in your tag list, not "latest"

bethskurrie
2020-07-16 03:15
the fact that it doesn't return anything even when you have no tags is very weird.

bethskurrie
2020-07-16 03:15
You've checked in the UI that they got published?

bethskurrie
2020-07-16 03:15
And have you tried changing the log level to DEBUG to see what you get?

sairsule
2020-07-16 03:16
```Running tool: C:\Go\bin\go.exe test -timeout 60s userdata/pact-tests -run ^TestProvider$ 2020/07/16 08:46:00 [DEBUG] pact setup logging 2020/07/16 08:46:00 [DEBUG] pact setup 2020/07/16 08:46:00 [DEBUG] checking CLI compatability 2020/07/16 08:46:00 [INFO] checking pact-mock-service within range >= 3.5.0, < 4.0.0 2020/07/16 08:46:00 [DEBUG] running binary pact-mock-service 2020/07/16 08:46:06 [DEBUG] checking version for binary pact-mock-service version 3.6.1 2020/07/16 08:46:06 [DEBUG] checking if version 3.6.1 within semver range >= 3.5.0, < 4.0.0 2020/07/16 08:46:06 [DEBUG] 3.6.1 satisfies constraints 3.6.1 >= 3.5.0, < 4.0.0 2020/07/16 08:46:06 [INFO] checking pact-provider-verifier within range >= 1.30.0, < 2.0.0 2020/07/16 08:46:06 [DEBUG] running binary pact-provider-verifier 2020/07/16 08:46:14 [DEBUG] checking version for binary pact-provider-verifier version 1.30.1 2020/07/16 08:46:14 [DEBUG] checking if version 1.30.1 within semver range >= 1.30.0, < 2.0.0 2020/07/16 08:46:14 [DEBUG] 1.30.1 satisfies constraints 1.30.1 >= 1.30.0, < 2.0.0 2020/07/16 08:46:14 [INFO] checking pact-broker within range >= 1.22.3 2020/07/16 08:46:14 [DEBUG] running binary pact-broker 2020/07/16 08:46:15 [DEBUG] checking version for binary pact-broker version 1.26.0 2020/07/16 08:46:15 [DEBUG] checking if version 1.26.0 within semver range >= 1.22.3 2020/07/16 08:46:15 [DEBUG] 1.26.0 satisfies constraints 1.26.0 >= 1.22.3 2020/07/16 08:46:15 [DEBUG] setting up a service manager 2020/07/16 08:46:15 [DEBUG] setting up a service manager 2020/07/16 08:46:15 [DEBUG] setting up a service manager 2020/07/16 08:46:15 [DEBUG] setting up a service manager 2020/07/16 08:46:15 [DEBUG] starting service creation monitor 2020/07/16 08:46:15 [DEBUG] starting service removal monitor 2020/07/16 08:46:15 [DEBUG] starting service removal monitor 2020/07/16 08:46:15 [DEBUG] starting service creation monitor 2020/07/16 08:46:15 [DEBUG] starting service creation monitor 2020/07/16 08:46:15 [DEBUG] starting service removal monitor 2020/07/16 08:46:15 [DEBUG] starting service creation monitor 2020/07/16 08:46:15 [DEBUG] starting service removal monitor 2020/07/16 08:46:15 [DEBUG] starting new proxy with opts {http localhost:8000 0 [0x6e6830] /__setup <nil>} 2020/07/16 08:46:15 [DEBUG] starting reverse proxy on port 51025 2020/07/16 08:46:15 [DEBUG] waiting for port 51025 to become available 2020/07/16 08:46:15 [DEBUG] pact provider verification 2020/07/16 08:46:15 [DEBUG] client: verifying a provider --- FAIL: TestProvider (14.46s) pact.go:413: No pacts found to verify. Check the tags provided (master) for your broker (http://127.0.0.1) are correct FAIL FAIL userdata/pact-tests 18.745s FAIL```

sairsule
2020-07-16 03:16
debug logs

bethskurrie
2020-07-16 03:17
@matt.fellows is there a way to pass the --verbose flag to the underlying CLI?

sairsule
2020-07-16 03:19
my pactbroker dashboard

bethskurrie
2020-07-16 03:20
Is the ruby standalone at the latest version?

sairsule
2020-07-16 03:22
i am using docker image: dius/pact-broker.

bethskurrie
2020-07-16 03:22
what version?

bethskurrie
2020-07-16 03:23
also, the go library delegates to the "pact ruby standalone", which is installed separately. Can you find out the version, and upgrade it if it's not the latest.


matt.fellows
2020-07-16 03:37
no, it breaks the JSON output. Or at least it did

matt.fellows
2020-07-16 03:37
the flag is there (for backwards ?compatibility?) but is ineffective

bethskurrie
2020-07-16 03:38
hm. I was sure I made the output go to stderr.

bethskurrie
2020-07-16 03:38
it's not meant to break

sairsule
2020-07-16 03:45
I didn't had ruby installed. So installed latest version. Still the same issue.

bethskurrie
2020-07-16 03:45
You don't need ruby

bethskurrie
2020-07-16 03:45
it comes bundled with the package. That's why it's called the "pact ruby standalone"

bethskurrie
2020-07-16 03:47
I really need to see the output from the underlying CLI.

bethskurrie
2020-07-16 03:47
Matt says it breaks the tests though.

bethskurrie
2020-07-16 03:47
If you can see how to set the verbose flag, can you try it, even if it breaks things.


sairsule
2020-07-16 03:50
where to set this verbose flag?

bethskurrie
2020-07-16 03:50
I'm not sure.

bethskurrie
2020-07-16 03:51
just try setting it at the top level.

bethskurrie
2020-07-16 03:51
see if it works :wink:

sairsule
2020-07-16 03:52
Already tried that :slightly_smiling_face: doesn't work

matt.fellows
2020-07-16 04:03
What?s confusing about the above DEBUG output @sairsule is that there should be a debug output showing how it?s invoking the verification process, and the flags it?s using

matt.fellows
2020-07-16 04:03
If you haven?t already, please set your log level to `DEBUG` - that will help

bethskurrie
2020-07-16 04:04
is the pact-go at the very latest version?

bethskurrie
2020-07-16 04:04
I wonder if there's an error somewhere that's stopping it running

matt.fellows
2020-07-16 04:04
possibly

matt.fellows
2020-07-16 04:04
The other thing is just remove pact-go altogether and invoke the verifier directly: e.g. something like `pact-provider-verifier --provider-base-url http://localhost:1234 --pact-broker-base-url http://localhost ?`

matt.fellows
2020-07-16 04:05
pass in any base url, because it will only try and talk to the base url if the pacts were found

matt.fellows
2020-07-16 04:06
it may well be fixed now

sairsule
2020-07-16 04:44
```C:\tools\pact\bin>pact-provider-verifier --provider-base-url http://localhost:8080 userdataconsumergo-userdataprovider.json --tag master --broker-user myusername --broker-password mypassword --pact-broker-base-url localhost --provider UserDataProvider C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/hal/http_client.rb:38:in `create_request': undefined method `request_uri' for #<URI::Generic localhost> (NoMethodError) from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/hal/http_client.rb:24:in `get' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/hal/link.rb:49:in `get' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb:50:in `index' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb:37:in `call' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb:33:in `call' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/pact_broker.rb:18:in `fetch_pact_uris_for_verification'```

sairsule
2020-07-16 04:45
get this error when running pact-provider-verifier

matt.fellows
2020-07-16 04:59
Missing http prefix for broker URL

sairsule
2020-07-16 05:03
```C:\tools\pact2\pact-1.86.0-win32\pact\bin>pact-provider-verifier --provider-base-url http://localhost:8080 userdataconsumergo-userdataprovider.json --tag master --broker-user myusername --broker-password mypassword --pact-broker-base-url http://localhost --provider UserDataProvider C:/tools/pact2/pact-1.86.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact-1.50.1/lib/pact/hal/entity.rb:102:in `assert_success!': Error retrieving http://localhost status=401 (Pact::Hal::ErrorResponseReturned) from C:/tools/pact2/pact-1.86.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact-1.50.1/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb:50:in `index' from C:/tools/pact2/pact-1.86.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact-1.50.1/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb:37:in `call' from C:/tools/pact2/pact-1.86.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact-1.50.1/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb:33:in `call' from C:/tools/pact2/pact-1.86.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact-1.50.1/lib/pact/pact_broker.rb:18:in `fetch_pact_uris_for_verification'```

sairsule
2020-07-16 05:03
same issue with after adding http://

matt.fellows
2020-07-16 05:06
Different error. 401 your creds are wrong

sairsule
2020-07-16 05:26
:hushed: should not be, these are the credentials I use to login on browser

sairsule
2020-07-16 05:26
```version: "3" services: postgres: image: postgres healthcheck: test: psql postgres --command "select 1" -U postgres environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: password POSTGRES_DB: postgres pact-broker: image: dius/pact-broker # build: # context: . depends_on: - postgres environment: PACT_BROKER_DATABASE_USERNAME: postgres PACT_BROKER_DATABASE_PASSWORD: password PACT_BROKER_DATABASE_HOST: postgres PACT_BROKER_DATABASE_NAME: postgres PACT_BROKER_LOG_LEVEL: INFO PACT_BROKER_BASIC_AUTH_USERNAME: myusername PACT_BROKER_BASIC_AUTH_PASSWORD: mypassword ports: - "80:80" ```

sairsule
2020-07-16 05:27
my docker-compose file

bethskurrie
2020-07-16 05:36
401 is definitely incorrect credentials

matt.fellows
2020-07-16 05:49
Wondering if perhaps it?s a windows shell escaping thing?

matt.fellows
2020-07-16 05:49
what happens if you do something (equivalent) to `curl localhost --user myusername:mypassword` - do you get a JSON response?

matt.fellows
2020-07-16 05:50
ah, it?s `--broker-username` not `--broker-user`

matt.fellows
2020-07-16 05:50
```pact-provider-verifier --provider-base-url http://localhost:8080 userdataconsumergo-userdataprovider.json --tag master --broker-username myusername --broker-password mypassword --pact-broker-base-url http://localhost --provider UserDataProvider```

sairsule
2020-07-16 06:02
ah.

sairsule
2020-07-16 06:02
but now another error ```Error reading file from --tag No such file or directory @ rb_sysopen - --tag C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.15.0/lib/pact/consumer_contract/pact_file.rb:51:in `read' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.15.0/lib/pact/consumer_contract/pact_file.rb:51:in `get_local' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.15.0/lib/pact/consumer_contract/pact_file.rb:41:in `render_pact' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.15.0/lib/pact/consumer_contract/pact_file.rb:22:in `read' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/pact_source.rb:16:in `pact_json' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/pact_spec_runner.rb:115:in `collect' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/pact_spec_runner.rb:115:in `pact_jsons' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/pact_spec_runner.rb:78:in `configure_rspec' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/pact_spec_runner.rb:32:in `run'```

matt.fellows
2020-07-16 06:03
you have a .json file half way through that list of arguments. It shouldn?t be there at all, because you are pointing to a broker

sairsule
2020-07-16 06:17
same issue even after removing it

matt.fellows
2020-07-16 06:26
exactly the same? Can you please show the command + output

sairsule
2020-07-16 06:35
```C:\tools\pact\bin>pact-provider-verifier --provider-base-url http://localhost:8080 --tag master --broker-username myusername --broker-password mypassword --pact-broker-base-url http://localhost --provider UserDataProvider INFO: Fetching pacts for UserDataProvider from http://localhost INFO: Reading pact at http://myusername:*****@localhost/pacts/provider/UserDataProvider/consumer/UserDataConsumerGo/version/1.0.0 Verifying a pact between UserDataConsumerGo and UserDataProvider Given User with email exists Send user address with GET /users/user1@gmail.com returns a response which WARN: Skipping set up for provider state 'User with email exists' for consumer 'UserDataConsumerGo' as there is no --provider-states-setup-url specified. has status code 200 has a matching body includes headers "Content-Type" which matches /application\/json/ 1 interaction, 0 failures Error reading file from --tag No such file or directory @ rb_sysopen - --tag C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.15.0/lib/pact/consumer_contract/pact_file.rb:51:in `read' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.15.0/lib/pact/consumer_contract/pact_file.rb:51:in `get_local' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.15.0/lib/pact/consumer_contract/pact_file.rb:41:in `render_pact' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.15.0/lib/pact/consumer_contract/pact_file.rb:22:in `read' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/pact_source.rb:16:in `pact_json' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/pact_spec_runner.rb:115:in `collect' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/pact_spec_runner.rb:115:in `pact_jsons' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/pact_spec_runner.rb:78:in `configure_rspec' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/pact_spec_runner.rb:32:in `run' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/cli/run_pact_verification.rb:69:in `run_with_pact_uri_object' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/cli/run_pact_verification.rb:50:in `run_specs' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/cli/run_pact_verification.rb:21:in `call' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/cli/run_pact_verification.rb:13:in `call' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/app.rb:169:in `verify_pact' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/app.rb:43:in `block in call' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/app.rb:42:in `collect' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/app.rb:42:in `call' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/app.rb:34:in `call' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/cli/verify.rb:56:in `verify' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/cli/custom_thor.rb:17:in `start' C:/tools/pact/lib/app/pact-provider-verifier.rb:33:in `<main>' C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.15.0/lib/pact/consumer_contract/pact_file.rb:51:in `read': No such file or directory @ rb_sysopen - --tag (Errno::ENOENT) from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.15.0/lib/pact/consumer_contract/pact_file.rb:51:in `get_local' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.15.0/lib/pact/consumer_contract/pact_file.rb:41:in `render_pact' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-support-1.15.0/lib/pact/consumer_contract/pact_file.rb:22:in `read' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/pact_source.rb:16:in `pact_json' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/pact_spec_runner.rb:115:in `collect' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/pact_spec_runner.rb:115:in `pact_jsons' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/pact_spec_runner.rb:78:in `configure_rspec' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/provider/pact_spec_runner.rb:32:in `run' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/cli/run_pact_verification.rb:69:in `run_with_pact_uri_object' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/cli/run_pact_verification.rb:50:in `run_specs' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/cli/run_pact_verification.rb:21:in `call' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/cli/run_pact_verification.rb:13:in `call' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/app.rb:169:in `verify_pact' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/app.rb:43:in `block in call' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/app.rb:42:in `collect' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/app.rb:42:in `call' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/app.rb:34:in `call' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/cli/verify.rb:56:in `verify' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start' from C:/tools/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/cli/custom_thor.rb:17:in `start' from C:/tools/pact/lib/app/pact-provider-verifier.rb:33:in `<main>'```

matt.fellows
2020-07-16 06:37
that?s a different error!

abubics
2020-07-16 06:37
Looks like it's trying to load a file named `--tag`

abubics
2020-07-16 06:38
(but that error is the same first line in the last post :sweat_smile: )

matt.fellows
2020-07-16 06:38
Please check the CLI options

matt.fellows
2020-07-16 06:38
`--tag` is not an option, so it is trying to load it as a file

matt.fellows
2020-07-16 06:38
you want `--consumer-version-tag`

matt.fellows
2020-07-16 06:39
in any case, it definitely got to the broker and back

matt.fellows
2020-07-16 06:39
I?m wondering if it?s a windows issue, but can?t be certain

matt.fellows
2020-07-16 06:39
if you could please set LogLevel to DEBUG and share the logs in the go tests that?d be great

sairsule
2020-07-16 06:44
```Running tool: C:\Go\bin\go.exe test -timeout 60s userdata/pact-tests -run ^TestProvider$ 2020/07/16 12:13:44 [DEBUG] pact setup logging 2020/07/16 12:13:44 [DEBUG] pact setup 2020/07/16 12:13:44 [DEBUG] setting up a service manager 2020/07/16 12:13:44 [DEBUG] setting up a service manager 2020/07/16 12:13:44 [DEBUG] setting up a service manager 2020/07/16 12:13:44 [DEBUG] setting up a service manager 2020/07/16 12:13:44 [DEBUG] starting service removal monitor 2020/07/16 12:13:44 [DEBUG] starting service removal monitor 2020/07/16 12:13:44 [DEBUG] starting service creation monitor 2020/07/16 12:13:44 [DEBUG] starting service removal monitor 2020/07/16 12:13:44 [DEBUG] starting service creation monitor 2020/07/16 12:13:44 [DEBUG] starting service removal monitor 2020/07/16 12:13:44 [DEBUG] starting service creation monitor 2020/07/16 12:13:44 [DEBUG] starting service creation monitor 2020/07/16 12:13:44 [DEBUG] starting new proxy with opts {http localhost:8000 0 [0x6e6830] /__setup <nil>} 2020/07/16 12:13:44 [DEBUG] starting reverse proxy on port 53054 2020/07/16 12:13:44 [DEBUG] waiting for port 53054 to become available 2020/07/16 12:13:44 [DEBUG] pact provider verification 2020/07/16 12:13:44 [DEBUG] client: verifying a provider --- FAIL: TestProvider (0.07s) pact.go:413: No pacts found to verify. Check the tags provided (master) for your broker (http://localhost) are correct FAIL FAIL userdata/pact-tests 3.239s FAIL```

sairsule
2020-07-16 06:44
debug log

matt.fellows
2020-07-16 06:55
:thinking_face:

matt.fellows
2020-07-16 07:08
something is not right, it should be printing out the verification arguments

matt.fellows
2020-07-16 07:11
For example, this is the output of one of the example tests in the repo: ```go test -v -tags=provider -count=1 http://github.com/pact-foundation/pact-go/examples/mux/... -run TestExample === RUN TestExample_MuxProvider 2020/07/16 17:09:57 [DEBUG] pact setup logging 2020/07/16 17:09:57 [DEBUG] pact setup 2020/07/16 17:09:57 API starting: port 60722 ([::]:60722) 2020/07/16 17:09:57 [DEBUG] checking CLI compatability 2020/07/16 17:09:57 [INFO] checking pact-mock-service within range >= 3.5.0, < 4.0.0 2020/07/16 17:09:57 [DEBUG] running binary pact-mock-service 2020/07/16 17:09:58 [DEBUG] checking version for binary pact-mock-service version 3.6.1 2020/07/16 17:09:58 [DEBUG] checking if version 3.6.1 within semver range >= 3.5.0, < 4.0.0 2020/07/16 17:09:58 [DEBUG] 3.6.1 satisfies constraints 3.6.1 >= 3.5.0, < 4.0.0 2020/07/16 17:09:58 [INFO] checking pact-provider-verifier within range >= 1.31.0, < 2.0.0 2020/07/16 17:09:58 [DEBUG] running binary pact-provider-verifier 2020/07/16 17:09:58 [DEBUG] checking version for binary pact-provider-verifier version 1.31.0 2020/07/16 17:09:58 [DEBUG] checking if version 1.31.0 within semver range >= 1.31.0, < 2.0.0 2020/07/16 17:09:58 [DEBUG] 1.31.0 satisfies constraints 1.31.0 >= 1.31.0, < 2.0.0 2020/07/16 17:09:58 [INFO] checking pact-broker within range >= 1.22.3 2020/07/16 17:09:58 [DEBUG] running binary pact-broker 2020/07/16 17:09:58 [DEBUG] checking version for binary pact-broker version 1.27.0 2020/07/16 17:09:58 [DEBUG] checking if version 1.27.0 within semver range >= 1.22.3 2020/07/16 17:09:58 [DEBUG] 1.27.0 satisfies constraints 1.27.0 >= 1.22.3 2020/07/16 17:09:58 [DEBUG] setting up a service manager 2020/07/16 17:09:58 [DEBUG] setting up a service manager 2020/07/16 17:09:58 [DEBUG] setting up a service manager 2020/07/16 17:09:58 [DEBUG] setting up a service manager 2020/07/16 17:09:58 [DEBUG] starting service creation monitor 2020/07/16 17:09:58 [DEBUG] starting service creation monitor 2020/07/16 17:09:58 [DEBUG] starting service creation monitor 2020/07/16 17:09:58 [DEBUG] starting service removal monitor 2020/07/16 17:09:58 [DEBUG] starting service creation monitor 2020/07/16 17:09:58 [DEBUG] starting service removal monitor 2020/07/16 17:09:58 [DEBUG] starting service removal monitor 2020/07/16 17:09:58 [DEBUG] starting service removal monitor 2020/07/16 17:09:58 [DEBUG] starting new proxy with opts {http localhost:60722 0 [0x12ebb10 0x12ebd50 0x12ec270 0x12ee4e0] /__setup <nil>} 2020/07/16 17:09:58 [DEBUG] starting reverse proxy on port 60725 2020/07/16 17:09:58 [DEBUG] waiting for port 60725 to become available 2020/07/16 17:09:58 [DEBUG] pact provider verification 2020/07/16 17:09:58 [DEBUG] client: verifying a provider 2020/07/16 17:09:58 [DEBUG] waiting for port 60725 to become available 2020/07/16 17:09:58 [DEBUG] starting verification service with args: [/Users/matthewfellows/go/src/github.com/pact-foundation/pact-go/examples/mux/provider/../../pacts/jmarie-loginprovider.json --format json --provider-base-url http://localhost:60725 --provider-states-setup-url http://localhost:60725/__setup --provider loginprovider] 2020/07/16 17:09:59 [DEBUG] executing before hook 2020/07/16 17:09:59 [DEBUG] skipping state handler for request /login/10?foo=bar 2020/07/16 17:09:59 [DEBUG] http reverse proxy received connection from [::1]:60729 on path /login/10?foo=bar 2020/07/16 17:09:59 [DEBUG] setting proxy to target 2020/07/16 17:09:59 [DEBUG] incoming request /login/10?foo=bar 2020/07/16 17:09:59 [DEBUG] outgoing request to target http://localhost:60722/login/10?foo=bar 2020/07/16 17:09:59 [DEBUG] executing after hook 2020/07/16 17:09:59 [DEBUG] executing before hook 2020/07/16 17:09:59 [DEBUG] skipping state handler for request /login/10?foo=anything 2020/07/16 17:09:59 [DEBUG] http reverse proxy received connection from [::1]:60732 on path /login/10?foo=anything 2020/07/16 17:09:59 [DEBUG] setting proxy to target```

matt.fellows
2020-07-16 07:14
I think there is a bug in the error reporting code

sairsule
2020-07-16 07:15
:bananadance: found the issue. Provider version was missing. :slightly_smiling_face:

matt.fellows
2020-07-16 07:15
it doesn?t look like it?s allowed to start a port, and is timing out. but that error is being swallowed

matt.fellows
2020-07-16 07:15
oh dear. Strange it?s not throwing an error

matt.fellows
2020-07-16 07:21
you should be getting an error if that isn?t provided:

matt.fellows
2020-07-16 07:21
AH!

matt.fellows
2020-07-16 07:21
OK, go back to your test code

matt.fellows
2020-07-16 07:22
VerifyProvider returns an `error` - you need to check this!!

sairsule
2020-07-16 07:22
yeah, I got this error on cli, thats how I figured it out

matt.fellows
2020-07-16 07:22
ah

matt.fellows
2020-07-16 07:22
The error contains feedback about what went wrong, so please don?t discard that

sairsule
2020-07-16 07:23
:thumbsup:

sairsule
2020-07-16 07:23
also realised, FailIfNoPactsFound option is not present in dsl.VerifyMessageRequest

sairsule
2020-07-16 07:23
it it there by default?

matt.fellows
2020-07-16 07:26
hmm, that may be an oversight

matt.fellows
2020-07-16 07:26
could you please raise an issue? SHould be easy enough to add


os.shulyak
2020-07-17 07:09
has joined #pact-broker

matthew.thomas
2020-07-17 10:02
has joined #pact-broker


matt.fellows
2020-07-19 22:10
Cool to see http://booking.com using Pact!

matt.fellows
2020-07-19 22:14
Wondering if we should have a social sharing channel?

matt.fellows
2020-07-19 22:14
Or maybe just general

matt.fellows
2020-07-19 22:14
This would be relevant to most

bethskurrie
2020-07-19 22:14
I'll repost to general.

dattasai.chunduru
2020-07-20 06:15
has joined #pact-broker

mcruzdrake
2020-07-20 09:09
has joined #pact-broker

dattasai.chunduru
2020-07-20 09:36
Hi can anyone tell me how can I enable Whitelisting

dattasai.chunduru
2020-07-20 09:37
for Pact broker. I am using Pactborker yml file for creating pact broker instance

matt.fellows
2020-07-20 09:37
Datta have you read the docs? They are very clear

dattasai.chunduru
2020-07-20 09:41

dattasai.chunduru
2020-07-20 09:41
for doing whitelisting

dattasai.chunduru
2020-07-20 09:42
It has asked me to verify this link


dattasai.chunduru
2020-07-20 09:42
this is a GITHUB link


dattasai.chunduru
2020-07-20 09:43
yeah where can I find this .ru file

bethskurrie
2020-07-20 09:43
I don't know what this yaml file is that you're talking about.

bethskurrie
2020-07-20 09:44
We currently support a Docker image.

bethskurrie
2020-07-20 09:44
It's configured via environment variables.

bethskurrie
2020-07-20 09:44
You'll find the docs for that in the readme.

dattasai.chunduru
2020-07-20 09:46
Sorry I am talking about yml file

dattasai.chunduru
2020-07-20 09:46
What I mean is I have to set the whitelisitng in my yml file ?

matt.fellows
2020-07-20 10:06
What YAML file are you referring to?

dattasai.chunduru
2020-07-20 10:22
Pact broker yml file

matt.fellows
2020-07-20 10:22
There is no such thing. Are you talking about the Docker file?

dattasai.chunduru
2020-07-20 10:32
Yeah docker file

dattasai.chunduru
2020-07-20 10:33
I am saying about this docker-compose yml file


bethskurrie
2020-07-20 10:40
Yml file for what? From where?

yousafn
2020-07-20 10:46
I think you just need to add an env var for `PACT_BROKER_WEBHOOK_HOST_WHITELIST` in your `broker_app` https://github.com/pact-foundation/pact-broker-docker#webhook-whitelists

dattasai.chunduru
2020-07-20 11:28
Sorry for my slow understanding but I have to set PACT_BROKER_WEBHOOK_HOST_WHITELIST in my pactbroker url level ?

yousafn
2020-07-20 12:06
add a new line at `29` and `PACT_BROKER_WEBHOOK_HOST_WHITELIST: "whatever"`

antonello
2020-07-20 13:01
http://pact-broker/?tags=prod shows also all the latest tagged pacticipants and not just the `prod` ones, is that expected behaviour?

dattasai.chunduru
2020-07-20 18:58
Hi All I am able to create a Webhook for PACT CONTRACT file but when it is trying to trigger the PIPELINE build it is showing error as below ```Errno::EADDRNOTAVAIL - Failed to open TCP connection to localhost:8080 (Cannot assign requested address - connect(2) for "localhost" port 8080)``` Can anyone please help me on this .

dattasai.chunduru
2020-07-20 19:15
I have tried to open TCP connection for Port 8080 but still it is showing same error

phil.endsley
2020-07-20 19:17
I'm making a couple assumptions based on some of your previous posts. 1. You're running pactbroker with docker-compose 2. You have Jenkins running on your machine on port 8080? 3. Your webhook is configured to make a request to localhost:8080 PactBroker will make the call to localhost:8080, but since you're running this with Docker, it will be making this request to that container's localhost. It doesn't seem likely you're running Jenkins in the broker container

dattasai.chunduru
2020-07-20 19:22
Yes I'm running my jenkins on local port 8080

dattasai.chunduru
2020-07-20 19:22
I am not running Jenkins in broker container

dattasai.chunduru
2020-07-20 19:23
I am running jenkins seperately

dattasai.chunduru
2020-07-20 19:23
Can you please give me a solution for this :disappointed:

phil.endsley
2020-07-20 19:23
Are you running broker on your machine as well?

dattasai.chunduru
2020-07-20 19:24
Yes I am running broker also on my machine on port 8113

phil.endsley
2020-07-20 19:32
Disclaimer: I'm not an expert...I know just enough to be dangerous :slightly_smiling_face: I'm pretty sure you need to configure your pactbroker docker network to use your host machine's network. You should be able to do this in the compose file. https://docs.docker.com/compose/compose-file/#network_mode Once you do that, I think you'll also need to update your webhook from `localhost:8080` to `127.0.0.1:8080` Note that if you do this, you won't be able to use port mapping (Because it's already running on your host machine's network), so you may also run into port conflicts if you have other applications using those ports. https://docs.docker.com/compose/compose-file/#ports

ashish_garg5
2020-07-21 06:27
has joined #pact-broker

ashish_garg5
2020-07-21 06:28
Hi All, ```http://localhost:8500/pacts/provider/provider/consumer/consumer/version/1.0.0``` I am using this broker url to make a put request in python now i want to add pact-broker-username and pact-broker-password as well, how to do that ? Can i pass in this same url or there is any other way. Thanks.

matt.fellows
2020-07-21 06:28
the username and password are basic auth credentials, so you need to consult the docs for your Python HTTP client about how to add those

matt.fellows
2020-07-21 06:28
most clients have a way of adding these in

matt.fellows
2020-07-21 06:28
but why not use the Pact CLI tools for this purpose?


matt.fellows
2020-07-21 06:29
they are bundled with your Pact Python installation anyway

ashish_garg5
2020-07-21 06:29
ok let me check

ashish_garg5
2020-07-21 06:29
thanks


ashish_garg5
2020-07-21 06:30
i have added the pact broker username and password using the https://hub.docker.com/r/pactfoundation/pact-cli Now i want to pass these parameters in my code

abubics
2020-07-21 06:39
I guess there's 2 major lines of questioning here . . . ? What are you trying to do where you got it working by CLI, but also want to make it work from Python? ? What libraries are you using? (which has nothing to do with Pact, so maybe this isn't the best place to be asking)

sairsule
2020-07-21 06:46
I have self signed cert on pact-broker, I added the cert to ca-bundle.crt, still getting error while publishing pact. ```OpenSSL::SSL::SSLError SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed C:/tools/pact_o/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.26.0/lib/pact_broker/client/base_client.rb:101:in `put', attempt 1 of 3```

sairsule
2020-07-21 06:46
How to resolve this?

ashish_garg5
2020-07-21 06:49
ok so i have added PACT_BROKER_BASIC_AUTH_USERNAME and PACT_BROKER_BASIC_AUTH_PASSWORD in my docker-compose. Now my broker is having basic auth added. Now from my python repo i want to pass these parameter values while making a put request to broker ```http://localhost:8500/pacts/provider/provider/consumer/consumer/version/1.0.0``` with these values i want to pass TAG, USERNAME and PASSWORD also.

abubics
2020-07-21 06:51
are you trying to upload a pact file from python?

ashish_garg5
2020-07-21 06:51
yes

ashish_garg5
2020-07-21 06:53
```requests.put(broker_url, data = open(pactfile, 'rb'), headers=headers)``` m doing something like this. Above url is my broker_url

ashish_garg5
2020-07-21 06:53
previously i was able to upload when i haven't added basic auth

abubics
2020-07-21 06:59
This is a python & requests question, not a pact or pact-broker question

abubics
2020-07-21 07:00
You could ask in #pact-python , maybe someone will be familiar with the library you're using?

abubics
2020-07-21 07:00
Or look up the docs of that library :slightly_smiling_face: there should be info on an auth DSL, or how to set custom headers for auth

ashish_garg5
2020-07-21 07:01
ok thanks :slightly_smiling_face:

matt.fellows
2020-07-21 07:33
> i have added the pact broker username and password using the https://hub.docker.com/r/pactfoundation/pact-cli What does this mean, sorry? Are you using this CLI or still using the Python library?

maciej.olko
2020-07-21 07:33
has joined #pact-broker

matt.fellows
2020-07-21 07:36
as per the python channel, you may want to consider reading https://requests.readthedocs.io/en/master/user/authentication/#basic-authentication

matt.fellows
2020-07-21 07:37
(or get inspiration from that on whatever http client library you?re using)

siddharth.gupta
2020-07-21 14:35
Tagging version 1.0.0 of Event API Consumer as "Master1" c:/cloud/pact-1.84.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.26.0/lib/pact_broker/client/pact_file.rb:32:in `read': No such file or directory @ rb_sysopen - -a, (Errno::ENOENT) from c:/cloud/pact-1.84.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.26.0/lib/pact_broker/client/pact_file.rb:32:in `read' from c:/cloud/pact-1.84.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.26.0/lib/pact_broker/client/pact_file.rb:28:in `pact_hash' from c:/cloud/pact-1.84.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.26.0/lib/pact_broker/client/pact_file.rb:16:in `pact_name' from c:/cloud/pact-1.84.0-win32/pact/lib/vendor/ruby/2.2.0/gems/rake-10.5.0/lib/rake/file_list.rb:81:in `each' from c:/cloud/pact-1.84.0-win32/pact/lib/vendor/ruby/2.2.0/gems/rake-10.5.0/lib/rake/file_list.rb:81:in `group_by' from c:/cloud/pact-1.84.0-win32/pact/lib/vendor/ruby/2.2.0/gems/rake-10.5.0/lib/rake/file_list.rb:81:in `group_by' from c:/cloud/pact-1.84.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.26.0/lib/pact_broker/client/publish_pacts.rb:41:in `publish_pacts' from c:/cloud/pact-1.84.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.26.0/lib/pact_broker/client/publish_pacts.rb:27:in `call' from c:/cloud/pact-1.84.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.26.0/lib/pact_broker/client/publish_pacts.rb:13:in `call' from c:/cloud/pact-1.84.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.26.0/lib/pact_broker/client/cli/broker.rb:196:in `publish_pacts' from c:/cloud/pact-1.84.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.26.0/lib/pact_broker/client/cli/broker.rb:57:in `publish' from c:/cloud/pact-1.84.0-win32/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run' from c:/cloud/pact-1.84.0-win32/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command' from c:/cloud/pact-1.84.0-win32/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch' from c:/cloud/pact-1.84.0-win32/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start' from c:/cloud/pact-1.84.0-win32/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.26.0/lib/pact_broker/client/cli/custom_thor.rb:15:in `start' from c:/cloud/pact-1.84.0-win32/pact/lib/app/pact-broker.rb:28:in `<main>' c:\cloud\pact-1.84.0-win32\pact\bin>how to resolve this error

siddharth.gupta
2020-07-21 14:37
will appreciate help on this , not sure whats the error but its coming back from the broker guess . Am I missing something . I suspect that provider details are missing but could not get help information from Pact ruby stand alone client help --?

siddharth.gupta
2020-07-21 14:47
I am using following command

siddharth.gupta
2020-07-21 14:47
publish C:\cloud\pact-net-master\Samples\EventApi\Consumer.Tests\pacts\event_api_consumer-event_api.json -a, --consumer-app-version=1.0.0 -b, --broker-base-url=xx.xxx.xxx.xx -u,--broker-username=pactbrokeruser -p,--broker-password=password -t, --tag=Master1

siddharth.gupta
2020-07-21 14:47
with pact-broker.bat

joel.whalen
2020-07-21 15:04
We are implementing verification in CICD and I noticed that we forgot to add provider tags during the verification step. It has been working fine, but since I added the `--provider-version-tag` option, I?m getting this error: ```Error reading file from --provider-version-tag=test No such file or directory @ rb_sysopen - --provider-version-tag=test /usr/lib/ruby/gems/2.5.0/gems/pact-support-1.12.0/lib/pact/consumer_contract/pact_file.rb:51:in `read'``` We are using the docker image here https://hub.docker.com/r/pactfoundation/pact-cli, which doesn?t even list `provider-version-tag` as an option - are we sure the docker image is compatible with the documentation here https://github.com/pact-foundation/pact-provider-verifier#usage?

joel.whalen
2020-07-21 15:05
Our `docker-compose.yml` looks extremely similar to this one https://github.com/pact-foundation/pact-ruby-cli/blob/master/docker-compose-verify.yml except we added the provider tag option as well

matt.fellows
2020-07-22 00:30
could you please share the command/code you used to get this error?

matt.fellows
2020-07-22 00:30
It looks like the value for the `-a` flag is not coming through or some value is not present

siddharth.gupta
2020-07-22 04:09
hey Matt any idea how to proceed . fix or get more details ?

matt.fellows
2020-07-22 05:08
If you could please share the code you used that resulted in this failure, that would certainly help

siddharth.gupta
2020-07-22 05:09
publish C:\cloud\pact-net-master\Samples\EventApi\Consumer.Tests\pacts\event_api_consumer-event_api.json -a, --consumer-app-version=1.0.0 -b, --broker-base-url=xx.xxx.xxx.xx -u,--broker-username=pactbrokeruser -p,--broker-password=password -t, --tag=Master1

matt.fellows
2020-07-22 05:10
it?s the commas, remove the commas

siddharth.gupta
2020-07-22 05:10
ok , my bad :slightly_smiling_face:

matt.fellows
2020-07-22 05:10
yes, it?s not common for any CLI tool to accept commas between arguments

siddharth.gupta
2020-07-22 05:13
bin>pact-broker.bat publish C:\cloud\pact-net-master\Samples\EventApi\Consumer.Tests\pacts\event_api_consumer-event_api.json -a --consumer-app-version=1.0.0 -b --broker-base-url=xx.xxx.167.xx -u --broker-username=pactbrokeruser -p --broker-password=xyz No value provided for option '--consumer-app-version'

siddharth.gupta
2020-07-22 05:13
now it says no value provided for option --consumer-app-version'

matt.fellows
2020-07-22 05:16
OK, it looks like you?re passing both the short and long form of each option

matt.fellows
2020-07-22 05:16
`-a` is the shorthand for `--consumer-app-version`

matt.fellows
2020-07-22 05:16
don?t pass both of them

siddharth.gupta
2020-07-22 05:17
ok thanks for the quick reply , really appreciate it

matt.fellows
2020-07-22 05:17
something like this I guess ```pact-broker.bat publish C:\cloud\pact-net-master\Samples\EventApi\Consumer.Tests\pacts\event_api_consumer-event_api.json --consumer-app-version=1.0.0 --broker-base-url=xx.xxx.167.xx ---broker-username=pactbrokeruser --broker-password=xyz```

matt.fellows
2020-07-22 05:17
no probs

bethskurrie
2020-07-22 05:28
@antonello yes

bethskurrie
2020-07-22 05:42
@joel.whalen try removing the equals sign.

bethskurrie
2020-07-22 05:43
There is custom handling on that tag so that you can specify it multiple times.


bethskurrie
2020-07-22 05:45
I did add logic to support the = sign delimiter a few months ago. What version of the docker image are you on?

bethskurrie
2020-07-22 05:45
Yes, the documentation is accurate because it is exactly that tool that is installed on the docker image.

bethskurrie
2020-07-22 05:49
There are issues with self signed certificates on Windows @sairsule


antonello
2020-07-22 05:50
What?s the reason? I?m curious :)

bethskurrie
2020-07-22 05:50
Try updating it to the most recent. I was able to run with both a space and an = delimiter.

mamtha.3687
2020-07-22 06:19
has joined #pact-broker

mamtha.3687
2020-07-22 06:19
Hi, we are looking to use mysql for our pact broker. Unfortunately, we're getting 500 internal server error. Can you help with a sample docker-compose.yml and/or documentation with a working example for mysql configuration?

ranjanayush03
2020-07-22 06:19
has joined #pact-broker


bethskurrie
2020-07-22 06:23
The first link shows how to run the tests with a mysql database.


bethskurrie
2020-07-22 06:24
Take the mysql container from the first docker compose and use it to replace the postgres container in the second docker compose.

bethskurrie
2020-07-22 06:24
My guess is that you havne't actually created the database instance however.


bethskurrie
2020-07-22 07:21
Btw, I really really strongly recommend you use Postgres @mamtha.3687

bethskurrie
2020-07-22 07:21
MySQL is supported, but it's much more performant on Postgres.

ranjanayush03
2020-07-22 07:40
Hi Beth , I tried the steps but no luck it is still getting the internal server error..

mamtha.3687
2020-07-22 07:57
This is what we have so far on the docker-compose.yml file. Although the images are getting created, browsing the site says "We're sorry, but something went wrong"

mamtha.3687
2020-07-22 08:03
We're sticking to mysql due to a restriction.

matt.fellows
2020-07-22 11:59
@ranjanayush03 in case you missed it

matt.fellows
2020-07-22 11:59
why is the host set to an IP?

matt.fellows
2020-07-22 12:00
You should simply be `mysql` and there should be a link to the mysql service

joel.whalen
2020-07-22 13:20
I am using the latest in my docker compose file `pactfoundation/pact-cli:latest` Here?s the full compose: ```version: '3.7' services: cart-service-redis: container_name: cart-service-redis image: redis stdin_open: true tty: true networks: - cart-service volumes: - $WORKING_DIR/cart_service/docker_vm/redis.conf:/usr/local/etc/redis/redis.conf entrypoint: - /usr/local/bin/redis-server - /usr/local/etc/redis/redis.conf cart-service: depends_on: - cart-service-redis container_name: cart-service image: zorotools/cart-service build: context: $WORKING_DIR/cart_service dockerfile: $WORKING_DIR/cart_service/Dockerfile.k8s stdin_open: true tty: true networks: - zorotools-net - cart-service ports: - ${CART_SERVICE_PORT:-5040}:5040 environment: GOOGLE_CLOUD_PROJECT: $GOOGLE_CLOUD_PROJECT GOOGLE_PROJECT_ID: $GOOGLE_PROJECT_ID GOOGLE_APPLICATION_CREDENTIALS: /home/zoro/credentials/google-product.json REDISHOST: cart-service-redis PRODUCT_CACHE_HOST: $PRODUCT_CACHE_HOST PRODUCT_CACHE_PORT: $PRODUCT_CACHE_PORT PRODUCT_CACHE_COLLECTION: $PRODUCT_CACHE_COLLECTION LOGGING_SERVICE_ENDPOINT: $LOGGING_SERVICE_ENDPOINT SHIPPING_SERVICE_ENDPOINT: $SHIPPING_SERVICE_ENDPOINT ORDER_SERVICE_ENDPOINT: $ORDER_SERVICE_ENDPOINT PROMO_SERVICE_ENDPOINT: $PROMO_SERVICE_ENDPOINT TAX_SERVICE_ENDPOINT: $TAX_SERVICE_ENDPOINT RUN_GUNICORN: ${RUN_GUNICORN:-false} FIRESTORE_MIN_DELAY_SECONDS: $FIRESTORE_MIN_DELAY_SECONDS FIRESTORE_MAX_DELAY_SECONDS: $FIRESTORE_MAX_DELAY_SECONDS FIRESTORE_DELAY_MULTIPLIER: $FIRESTORE_DELAY_MULTIPLIER FIRESTORE_CALL_DEADLINE_SECONDS: $FIRESTORE_CALL_DEADLINE_SECONDS volumes: - $WORKING_DIR/cart_service:/home/zoro/app - $GOOGLE_APPLICATION_CREDENTIALS:/home/zoro/credentials/google-product.json entrypoint: - docker_vm/run.sh cart-service-test: depends_on: - cart-service container_name: cart-service-test image: zorotools/cart-service stdin_open: true tty: true networks: - cart-service-test volumes: - $WORKING_DIR/cart_service:/home/zoro/app entrypoint: - docker_vm/test.sh # Pact verification cart-service-verify: networks: - zorotools-net image: pactfoundation/pact-cli:latest container_name: cart-service-verify volumes: - $WORKING_DIR/cart_service:/home/zoro/app depends_on: - cart-service environment: PACT_BROKER_TOKEN: $PACT_BROKER_TOKEN PACT_BROKER_BASE_URL: $PACT_BROKER_BASE_URL CONSUMER_VERSION_TAG: $CONSUMER_VERSION_TAG PROVIDER_APP_VERSION: $PROVIDER_APP_VERSION command: > verify --provider-base-url http://cart-service:5040/v1 --provider "cart-service" --broker-token $PACT_BROKER_TOKEN --pact-broker-base-url $PACT_BROKER_BASE_URL --publish-verification-results --consumer-version-tag $CONSUMER_VERSION_TAG --provider-app-version $PROVIDER_APP_VERSION --provider-version-tag "test" networks: zorotools-net: external: True cart-service: cart-service-test:```

joel.whalen
2020-07-22 13:21
The `=` seems to have no effect

joel.whalen
2020-07-22 13:21
```Error reading file from --provider-version-tag No such file or directory @ rb_sysopen - --provider-version-tag /usr/lib/ruby/gems/2.5.0/gems/pact-support-1.12.0/lib/pact/consumer_contract/pact_file.rb:51:in `read' /usr/lib/ruby/gems/2.5.0/gems/pact-support-1.12.0/lib/pact/consumer_contract/pact_file.rb:51:in `get_local' /usr/lib/ruby/gems/2.5.0/gems/pact-support-1.12.0/lib/pact/consumer_contract/pact_file.rb:41:in `render_pact' /usr/lib/ruby/gems/2.5.0/gems/pact-support-1.12.0/lib/pact/consumer_contract/pact_file.rb:22:in `read' /usr/lib/ruby/gems/2.5.0/gems/pact-1.42.0/lib/pact/provider/pact_source.rb:14:in `pact_json' /usr/lib/ruby/gems/2.5.0/gems/pact-1.42.0/lib/pact/provider/pact_spec_runner.rb:116:in `collect' /usr/lib/ruby/gems/2.5.0/gems/pact-1.42.0/lib/pact/provider/pact_spec_runner.rb:116:in `pact_jsons' /usr/lib/ruby/gems/2.5.0/gems/pact-1.42.0/lib/pact/provider/pact_spec_runner.rb:79:in `configure_rspec' /usr/lib/ruby/gems/2.5.0/gems/pact-1.42.0/lib/pact/provider/pact_spec_runner.rb:33:in `run' /usr/lib/ruby/gems/2.5.0/gems/pact-1.42.0/lib/pact/cli/run_pact_verification.rb:63:in `run_with_pact_url_string' /usr/lib/ruby/gems/2.5.0/gems/pact-1.42.0/lib/pact/cli/run_pact_verification.rb:48:in `run_specs' /usr/lib/ruby/gems/2.5.0/gems/pact-1.42.0/lib/pact/cli/run_pact_verification.rb:21:in `call' /usr/lib/ruby/gems/2.5.0/gems/pact-1.42.0/lib/pact/cli/run_pact_verification.rb:14:in `call' /usr/lib/ruby/gems/2.5.0/gems/pact-provider-verifier-1.23.1/lib/pact/provider_verifier/app.rb:156:in `verify_pact' /usr/lib/ruby/gems/2.5.0/gems/pact-provider-verifier-1.23.1/lib/pact/provider_verifier/app.rb:37:in `block in call' /usr/lib/ruby/gems/2.5.0/gems/pact-provider-verifier-1.23.1/lib/pact/provider_verifier/app.rb:36:in `collect' /usr/lib/ruby/gems/2.5.0/gems/pact-provider-verifier-1.23.1/lib/pact/provider_verifier/app.rb:36:in `call' /usr/lib/ruby/gems/2.5.0/gems/pact-provider-verifier-1.23.1/lib/pact/provider_verifier/app.rb:28:in `call' /usr/lib/ruby/gems/2.5.0/gems/pact-provider-verifier-1.23.1/lib/pact/provider_verifier/cli/verify.rb:38:in `verify' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start' /usr/lib/ruby/gems/2.5.0/gems/pact-provider-verifier-1.23.1/lib/pact/provider_verifier/cli/custom_thor.rb:17:in `start' /pact/lib/pact/cli.rb:47:in `verify' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start' bin/pact:9:in `<top (required)>' /usr/local/lib/site_ruby/2.5.0/bundler/cli/exec.rb:74:in `load' /usr/local/lib/site_ruby/2.5.0/bundler/cli/exec.rb:74:in `kernel_load' /usr/local/lib/site_ruby/2.5.0/bundler/cli/exec.rb:28:in `run' /usr/local/lib/site_ruby/2.5.0/bundler/cli.rb:463:in `exec' /usr/local/lib/site_ruby/2.5.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run' /usr/local/lib/site_ruby/2.5.0/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command' /usr/local/lib/site_ruby/2.5.0/bundler/vendor/thor/lib/thor.rb:387:in `dispatch' /usr/local/lib/site_ruby/2.5.0/bundler/cli.rb:27:in `dispatch' /usr/local/lib/site_ruby/2.5.0/bundler/vendor/thor/lib/thor/base.rb:466:in `start' /usr/local/lib/site_ruby/2.5.0/bundler/cli.rb:18:in `start' /usr/lib/ruby/gems/2.5.0/gems/bundler-1.17.3/exe/bundle:30:in `block in <top (required)>' /usr/local/lib/site_ruby/2.5.0/bundler/friendly_errors.rb:124:in `with_friendly_errors' /usr/lib/ruby/gems/2.5.0/gems/bundler-1.17.3/exe/bundle:22:in `<top (required)>' /usr/bin/bundle:23:in `load' /usr/bin/bundle:23:in `<main>' bundler: failed to load command: bin/pact (bin/pact) Errno::ENOENT: No such file or directory @ rb_sysopen - --provider-version-tag /usr/lib/ruby/gems/2.5.0/gems/pact-support-1.12.0/lib/pact/consumer_contract/pact_file.rb:51:in `read' /usr/lib/ruby/gems/2.5.0/gems/pact-support-1.12.0/lib/pact/consumer_contract/pact_file.rb:51:in `get_local' /usr/lib/ruby/gems/2.5.0/gems/pact-support-1.12.0/lib/pact/consumer_contract/pact_file.rb:41:in `render_pact' /usr/lib/ruby/gems/2.5.0/gems/pact-support-1.12.0/lib/pact/consumer_contract/pact_file.rb:22:in `read' /usr/lib/ruby/gems/2.5.0/gems/pact-1.42.0/lib/pact/provider/pact_source.rb:14:in `pact_json' /usr/lib/ruby/gems/2.5.0/gems/pact-1.42.0/lib/pact/provider/pact_spec_runner.rb:116:in `collect' /usr/lib/ruby/gems/2.5.0/gems/pact-1.42.0/lib/pact/provider/pact_spec_runner.rb:116:in `pact_jsons' /usr/lib/ruby/gems/2.5.0/gems/pact-1.42.0/lib/pact/provider/pact_spec_runner.rb:79:in `configure_rspec' /usr/lib/ruby/gems/2.5.0/gems/pact-1.42.0/lib/pact/provider/pact_spec_runner.rb:33:in `run' /usr/lib/ruby/gems/2.5.0/gems/pact-1.42.0/lib/pact/cli/run_pact_verification.rb:63:in `run_with_pact_url_string' /usr/lib/ruby/gems/2.5.0/gems/pact-1.42.0/lib/pact/cli/run_pact_verification.rb:48:in `run_specs' /usr/lib/ruby/gems/2.5.0/gems/pact-1.42.0/lib/pact/cli/run_pact_verification.rb:21:in `call' /usr/lib/ruby/gems/2.5.0/gems/pact-1.42.0/lib/pact/cli/run_pact_verification.rb:14:in `call' /usr/lib/ruby/gems/2.5.0/gems/pact-provider-verifier-1.23.1/lib/pact/provider_verifier/app.rb:156:in `verify_pact' /usr/lib/ruby/gems/2.5.0/gems/pact-provider-verifier-1.23.1/lib/pact/provider_verifier/app.rb:37:in `block in call' /usr/lib/ruby/gems/2.5.0/gems/pact-provider-verifier-1.23.1/lib/pact/provider_verifier/app.rb:36:in `collect' /usr/lib/ruby/gems/2.5.0/gems/pact-provider-verifier-1.23.1/lib/pact/provider_verifier/app.rb:36:in `call' /usr/lib/ruby/gems/2.5.0/gems/pact-provider-verifier-1.23.1/lib/pact/provider_verifier/app.rb:28:in `call' /usr/lib/ruby/gems/2.5.0/gems/pact-provider-verifier-1.23.1/lib/pact/provider_verifier/cli/verify.rb:38:in `verify' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start' /usr/lib/ruby/gems/2.5.0/gems/pact-provider-verifier-1.23.1/lib/pact/provider_verifier/cli/custom_thor.rb:17:in `start' /pact/lib/pact/cli.rb:47:in `verify' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start' bin/pact:9:in `<top (required)>'```

mamtha.3687
2020-07-22 13:28
is it the jdbc url that needs to be specified as database url?

matt.fellows
2020-07-22 14:06
Yes, the fully qualified connection string

matt.fellows
2020-07-22 14:06
Jdbc is java

ranjanayush03
2020-07-22 14:45
Thank you for the response @matt.fellows tried that part now it is showing org.apache.http.NoHttpResponseException:localhost:9292 failed to respond..

mike.geeves
2020-07-22 19:20
(very depressing that was 2 months ago, can confirm it is working as expected, thanks! ...the oxymoron of "scaled agile")

mamtha.3687
2020-07-23 05:49
@matt.fellows thanks. I've changed the host to mysql and could you pls help with a sample mysql service link? My database properties shows the jdbc url only. I am using a mysql docker container and connecting to the database through intellij.

mamtha.3687
2020-07-23 05:50
Also can you confirm the environment variables needed for dius/pact-broker and what should the database adapter value be?

paul.stitt
2020-07-23 09:23
has joined #pact-broker

matt.fellows
2020-07-23 10:34
I?m sorry I don?t know how to run it on MySQL, I haven?t done it before

matt.fellows
2020-07-23 10:36
at the very least you will need to set `PACT_BROKER_DATABASE_URL` to the MySQL connection string

matt.fellows
2020-07-23 10:36
`DATABASE_ADAPTER` will need to be set to something like `mysql`

matt.fellows
2020-07-23 10:36
> Thank you for the response @matt.fellows tried that part now it is showing org.apache.http.NoHttpResponseException:localhost:9292 failed to respond.. That?s a Java error - the app is a Ruby app, where is that coming from?

matt.fellows
2020-07-23 10:37
Port `9292` is the port the broker is running on

mamtha.3687
2020-07-23 12:17
@matt.fellows thanks. Followed everything and there was one important thing we missed. The database url is expected to have mysql2://<link> not mysql. That did the trick. Now it works fine.

sagupta
2020-07-23 13:10
Hello I along with my ops team members are trying to host our own pact broker from the helm chart https://hub.helm.sh/charts/qamatic/pact-broker. However upon access, I can see the old PACT broker UI . Is the new ui which i see in pactflow only for the paid subscription?

praneethkumar
2020-07-23 13:48
Hi I am trying to install can I deploy in our PaaS environment & we are getting below error .

praneethkumar
2020-07-23 13:49
ADD release image is failing

praneethkumar
2020-07-23 14:14
Any idea what could be the issue ?

antonello
2020-07-23 14:33
What are you trying to do exactly? It looks like you?re trying to build the docker image?

praneethkumar
2020-07-23 14:36
Hi anto , we are trying to build the docker image of can I deploy

antonello
2020-07-23 14:36
there is no docker image of can-i-deploy as far as I know

antonello
2020-07-23 14:36
do you mean the pact broker client?

antonello
2020-07-23 14:36
which exposes the can-i-deploy command?

antonello
2020-07-23 14:38
If that?s the case you don?t need to build it - you should use the pre-built one that is available here https://hub.docker.com/r/pactfoundation/pact-cli

justaburneremailforso
2020-07-23 17:37
Is there a way to see what an actual verification failure is on the pact broker? Currently if the provider side verification fails, it just shows up as failed in the broker. If you are a consumer, there doesn't seem to be an obvious way to see what the provider verification failure actually is. This would be useful as in our case we have two teams (one consumer, one provider) who are new to Pact and currently onboarding. It would be helpful if the consumer could see on the broker why the verification is failing as they may need to update their contract.

ranjanayush03
2020-07-23 19:11
Hi all, I was working on the pact broker side and able to publish & verify the pact files which are stored on my system running on port 80 , but I want to configure in the Jenkins file of my project so that when I run the script it automatically publishes the pact file to the broker . We are using pact-dius docker image and a docker image of mysql running on port 3306 for local setup. So are there any changes that I need to do to configure it in Jenkins . Thanks

matt.fellows
2020-07-23 22:33
Yes, Pactflow is a commercial product that enhances the open source broker

matt.fellows
2020-07-23 22:34
There are a bunch of features the OSS broker doesn't have that are in Pactflow

matt.fellows
2020-07-23 22:34
We do have an on premise version available if that's of interest

phil.endsley
2020-07-24 02:29
Is there any way to troubleshoot/debug why a pact is not included as a WIP pact? I have a consumer pact that has never been verified by anything. When I call the `for-verification` endpoint, I only get back the pacts that match criteria from my `consumerVersionSelectors`. ```https://pactbrokerUrl/pacts/provider/my-provider/for-verification {     "consumerVersionSelectors": [{"tag": "develop", "latest": true}],     "includePendingStatus": true,     "includeWipPactsSince": "02/07/2020",     "providerVersionTags": ["provider-feat"] }```

phil.endsley
2020-07-24 02:30
> has never been verified by anything Is this an issue?

phil.endsley
2020-07-24 02:57
https://docs.pact.io/faq/#is-there-a-jenkins-plugin-for-pact Nothing really changes. Like it says in the docs, everything runs in the application builds

ranjanayush03
2020-07-24 03:27
Actually @phil.endsley I finished the workshop on ci-cd that is mentioned in the pactflow docs, but when running it on pact broker the docker image of the dius/pact and the postgres sql needs to be pulled first in the Jenkins script . And I was able to successfully publish and verify the pact running on localhost:80 , so while publishing it via Jenkins do we need a hosted database or the localhost thing will work I am confused, so how to implement these..

phil.endsley
2020-07-24 04:06
The provider tag didn't exist anywhere. If I add it to something, it starts working. I'm pretty sure I've done this same exact thing before. Here's hoping I remember next time

phil.endsley
2020-07-24 04:06
I guess I always expect it to just match on every wip pact in the date range if the provider tag doesn't exist

sidhartha.k.subudhi
2020-07-24 16:57
has joined #pact-broker

bzifkin
2020-07-24 18:36
has joined #pact-broker

bethskurrie
2020-07-25 04:14
@kong I've somehow managed to screw up the nice little 115MB docker image we had with my recent changes to delete vulnerable versions of Rack https://hub.docker.com/repository/docker/pactfoundation/pact-broker/tags?page=1 I don't understand how the layers work well enough to understand why what I've done makes the image so much bigger. Do you have any suggestions? https://github.com/pact-foundation/pact-broker-docker/blob/master/Dockerfile


bethskurrie
2020-07-25 04:20
I'll try running the build with --squash

bethskurrie
2020-07-25 04:22
ok, that's experimental and unlikely to be available on Github Actions.


kong
2020-07-25 04:24
this line: ``` apk add --update --no-cache make gcc libc-dev mariadb-dev postgresql-dev sqlite-dev git``` could probably be: ```... apk add --update --no-cache mariadb-dev postgresql-dev sqlite-dev RUN set -ex && \ apk add --update --no-cache make gcc libc-dev git gem install bundler -v $(cat BUNDLER_VERSION) && \ ls /usr/local/lib/ruby/gems/2.6.0 && \ gem uninstall --install-dir /usr/local/lib/ruby/gems/2.6.0 -x rake && \ find /usr/local/lib/ruby -name webrick* -exec rm -rf {} + && \ bundle config set deployment 'true' && \ bundle config set no-cache 'true' && \ bundle install --without='development test' && \ rm -rf vendor/bundle/ruby/*/cache .bundle/cache && \ apk del make gcc libc-dev git```

kong
2020-07-25 04:25
it?s possibly the git packages that has inflated the size

bethskurrie
2020-07-25 04:26
sorry, I can't see what's different

kong
2020-07-25 04:28
1 minute. let me run a build

bethskurrie
2020-07-25 04:28
ta

bethskurrie
2020-07-25 04:28
I'm think the docker-squash might be needed.

kong
2020-07-25 05:45
```REPOSITORY TAG IMAGE ID CREATED SIZE pact-broker edge 1ab9002a65db 5 minutes ago 403MB pactfoundation/pact-broker latest b20c8dcf0d71 5 hours ago 556MB pactfoundation/pact-broker 2.58.2.3 906a08fe34ea 5 days ago 317MB``` alright, manage to drop it down to 403MB uncompressed. kinda in the middle between the releases. I?m trying to get `docker squash` to work and compare it now

bethskurrie
2020-07-25 05:45
I'm mostly concerned about the compressed size.

bethskurrie
2020-07-25 05:46
that's the one that people complain about!

kong
2020-07-25 05:54
compressed size will be 136MB ```-rw-rw-r-- 1 kong kong 136M Jul 24 22:52 pact-broker.edge.tar.gz``` which is slightly bigger than the 115 we originally had

bethskurrie
2020-07-25 05:54
better than 190

kong
2020-07-25 06:01
PR raised

kong
2020-07-25 06:01
i somehow cannot get docker-squash to work locally. must be missing something important with `docker load` :confused:

bethskurrie
2020-07-25 06:02
ta!

mike.geeves
2020-07-25 13:35
To elaborate on Ken's comment, in the setup ruby user you're installing gcc, libc-dev, and git. At that point is taking up space for the layer created by the RUN command Those packages are then removed in the second RUN part of install gems - but when you download them all together you will still be getting that first layer will the files in, and effectively applying a patch (thinking in Dev terms) to remove them Think of it as each command is like a pull request with squash commits :) you can add loads in during the various commits and then remove them, but the final diff is just whatever you ended up with. Same applies. -> So if you add them in during the same RUN command as you remove them, they aren't included in the "merge" for that layer Squash can then take that a step further, but then you would need to get the whole thing each time. We try for example to have a base image with all packages and then services are more or less just adding the src files, so then to get an update it's just the final layer which is tiny to download, the rest with the packages is still valid and can be reused

elliottmurray
2020-07-26 09:02
Couldn?t that dockerfile be done with multi stages?

mike.geeves
2020-07-26 14:39
:thinking_face: I only have very limited experience of trying them, mostly due to intentional avoidance :smile: I think the answer is yes, but they're a great way - if you (or the person after you..) don't know what you're doing - of creating some Frankenstein's monster of different distros that when you try to use the finished result at the end, a limb or two falls off :smile: Would be interesting to hear of positive experience of them though!

elliottmurray
2020-07-26 17:45
I think a dev stage might just avoid the install of certain dev tools. But :woman-shrugging::skin-tone-2:

mike.geeves
2020-07-26 18:06
Yeah, it's fine until someone comes along and swaps out e.g. your Debian image for an alpine one only on the build stage, and then Bad Things happen :joy:

bethskurrie
2020-07-26 21:45
If someone wants to have a go, be my guest!

bethskurrie
2020-07-26 21:47
@ranjanayush03 are you starting up and shutting down the Pact Broker with each Jenkins build?

bethskurrie
2020-07-26 21:49
The Pact Broker needs to be always up and running. It's not something you can start up and shut down for each build. It's like Jenkins itself - it's always running.



bethskurrie
2020-07-26 21:50
@justaburneremailforso this UI is available in Pactflow.

bethskurrie
2020-07-26 21:50
You can see the results in the Pact Broker, however, you need to use the API browser to get to them, as there is no UI built for them.

bethskurrie
2020-07-26 22:01
@ranjanayush03 it seems that you are unclear on the Pact/Pact Broker workflow. Have you thoroughly read the docs at http://docs.pact.io?

bethskurrie
2020-07-26 22:02
There is a step by step guide for setting up a workflow here https://docs.pact.io/pact_nirvana


bethskurrie
2020-07-26 22:12
@joel.whalen have you done a `pull pactfoundation/pact-cli:latest` recently?

bethskurrie
2020-07-26 22:13
Also, have you tried running the example one to see that it works on your machine?

bethskurrie
2020-07-26 22:15
I can see from your stack trace that the image you are using has pact-provider-verifier-1.23.1. The current one has version 1.32.1.

bethskurrie
2020-07-26 22:16
It would be best to fix the tag to a known version in your docker compose file.

bethskurrie
2020-07-26 23:29
@antonello it seemed like the right thing to do when it was implemented years ago.

bethskurrie
2020-07-26 23:29
Possibly before tagging was such an integral part of Pact.

ranjanayush03
2020-07-27 03:54
Thank you @bethskurrie will try to go through the documents and in in case of any queries will try to rectify..

poojashree_gopal
2020-07-27 04:00
has joined #pact-broker

sagupta
2020-07-27 09:26
alright, are the API token to push the contract and pull the contract also available for OSS broker? I mean after deploying it on our env , i couldnt find those

matt.fellows
2020-07-27 09:27
No they are not

matt.fellows
2020-07-27 09:27
We support a basic auth option or you can secure it with your own tooling etc

sagupta
2020-07-27 09:44
Alright got it, i just tried to push the contract by just passing the PACT_BROKER_URL and it works . And regarding the on premise version , is this the on premise version for pactflow ? And that is open source?

matt.fellows
2020-07-27 09:45
No, the open source broker is the open source one :relaxed:

matt.fellows
2020-07-27 09:45
The on premise Pactflow is also a commercial version.

matt.fellows
2020-07-27 09:46
I mentioned it in case SaaS wasn't an option but you wanted the features

sagupta
2020-07-27 09:48
right, makes sense. Is there any documentation on difference of features between pactflow and open source broker . Can help us decide if we want to go for commercial one or not

matt.fellows
2020-07-27 10:30
https://pactflow.io/features/ is probably a good starting point. There's lots of little features in the UI as you can imagine. We're currently building our teams and permissions features

matt.fellows
2020-07-27 10:30
This is our near term roadmap also https://pactflow.io/pactflow-feature-roadmap/

sagupta
2020-07-27 11:08
thanks a lot :slightly_smiling_face:

pavel.kirpichyov
2020-07-27 12:37
has joined #pact-broker

alexei.hmelevski
2020-07-27 13:13
has joined #pact-broker

mamtha.3687
2020-07-27 19:22
Is there any documentation available for hosting the pact broker on PCF?

joel.whalen
2020-07-27 19:46
aha that worked! Thanks @bethskurrie I specified `pactfoundation/pact-cli:0.11.3.0` instead of `pactfoundation/pact-cli:latest` and that did it.

antonello
2020-07-27 21:53
Understood. So in theory it would make sense to behave differently now.

jarmy
2020-07-27 22:45
A provider team I?m working with has the potential to verify multiple consumers. They want to know if one of the consumer contracts breaks (for example: they determine the consumer published a bad contract), would it be possible for the provider to disable that pact? And, could they do it without making a code change on their end? Is it possible to handle something like this with the `pact_broker-client,` or, the pact-broker API?

phil.endsley
2020-07-27 22:48
The provider team can enable the pending pacts feature to prevent "bad" contracts from breaking the build and preventing deployments. The verification is still published as a failure, so the consumer can't deploy until it's corrected, but the provider build stays green


jarmy
2020-07-27 22:49
I?m seeing _NOTE_: This feature is currently only available on https://pactflow.io/ https://github.com/pact-foundation/pact-js#pending-pacts

phil.endsley
2020-07-27 22:52
Ah...haven't tried using it with js, and am not familiar enough with it. It's dependent on the client library. We use the jvm libs, and it's supported there. Might try checking the open issues for the repo, or asking if it's supported yet in the pact-js channel

phil.endsley
2020-07-27 22:53
It might just be out of date if it's referring to broker capabilities though... @matt.fellows would probably know for sure

joaquin
2020-07-27 23:13
has joined #pact-broker

matt.fellows
2020-07-27 23:49
That note is out of date, I?ll update now

matt.fellows
2020-07-27 23:50
seee https://docs.pact.io/pending and https://docs.pact.io/pact_broker/advanced_topics/wip_pacts. The latter article explains how to setup your self-hosted broker with the feature enabled

matt.fellows
2020-07-27 23:53
Updated. Thanks for the spot

matt.fellows
2020-07-27 23:53
Not that I?m aware of sorry!

jarmy
2020-07-27 23:57
Does the `PACT_BROKER_FEATURES=pacts_for_verification` config enable both _pending pacts_ and _WIP pacts?_

matt.fellows
2020-07-28 00:00
Yes

matt.fellows
2020-07-28 00:00
that?s the underlying capability that both WIP and Pending need

jarmy
2020-07-28 00:00
Gotcha. Thanks

pulgupta
2020-07-28 04:06
has joined #pact-broker

david025
2020-07-28 15:27
has joined #pact-broker

daniel.pritchard
2020-07-29 08:31
has joined #pact-broker

marco.dallagiacoma
2020-07-29 09:41
has joined #pact-broker

jan.krejci
2020-07-29 12:29
has joined #pact-broker

praneethkumar
2020-07-29 14:23
I am trying to trigger a webhook to call Jenkins job where the providers job is configured . But I am getting the below error HTTP:/1.1 403 No valid crumb was included in the request . I have provide the crumb , but still getting an error . Anyone faced the same issue ?

elliottmurray
2020-07-29 16:29
I?m having a little bit of a problem with Travis - I can?t get my examples to run in it. It doesn?t seem to be opening the provider on a certain port. Tests can?t connect. I?ve tried a few things - works on my machine etc. but a bit stuck as to why it doesn?t on travis. Any known gotchas? I see pact js disabled ipv6 and some sudo stuff which I aligned python to but didn?t help

elliottmurray
2020-07-29 17:58
urgh - wrong place

mike.geeves
2020-07-29 18:04
:thinking_face: no clue Travis specifically, I've had quite a bit of trouble with local vs GitLab CI until splitting out the docker containers I was spinning up to their own network, then the provider could be run by name rather than IP and Magic happened to connect. Could be something similar if you're using containers?

elliottmurray
2020-07-29 20:18
I re posted this in maintainers. You still can?t delete threaded posts?

elliottmurray
2020-07-29 20:19
It was actually to do with python. Not docker at all. Apologies

joel.whalen
2020-07-29 21:20
Some more strange behavior with the pact broker CLI docker image. When I just run the `publish` command alone, it runs and correctly tells me I?m missing some arguments, see here: ``` # Publish Pacts cart-service-publish-pacts: container_name: cart-service-publish-pacts image: pactfoundation/pact-cli:0.11.3.0 environment: PACT_BROKER_TOKEN: $PACT_BROKER_TOKEN PACT_BROKER_BASE_URL: $PACT_BROKER_BASE_URL CONSUMER_APP_VERSION: $CONSUMER_APP_VERSION CONSUMER_VERSION_TAG: $CONSUMER_VERSION_TAG volumes: - $WORKING_DIR/cart_service/pacts:/pact/pacts command: > publish``` produces (expected output): ```No value provided for required options '--consumer-app-version'``` but when I append the `--consumer-app-version` argument like so: ``` # Publish Pacts cart-service-publish-pacts: container_name: cart-service-publish-pacts image: pactfoundation/pact-cli:0.11.3.0 environment: PACT_BROKER_TOKEN: $PACT_BROKER_TOKEN PACT_BROKER_BASE_URL: $PACT_BROKER_BASE_URL CONSUMER_APP_VERSION: $CONSUMER_APP_VERSION CONSUMER_VERSION_TAG: $CONSUMER_VERSION_TAG volumes: - $WORKING_DIR/cart_service/pacts:/pact/pacts command: > publish --consumer-app-version $CONSUMER_APP_VERSION``` I get this error: ```bundler: failed to load command: bin/pact (bin/pact) NameError: uninitialized constant PactBroker::Client::Error /usr/lib/ruby/gems/2.5.0/gems/pact_broker-client-1.28.3/lib/pact_broker/client/cli/broker.rb:60:in `rescue in publish' /usr/lib/ruby/gems/2.5.0/gems/pact_broker-client-1.28.3/lib/pact_broker/client/cli/broker.rb:55:in `publish' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start' /usr/lib/ruby/gems/2.5.0/gems/pact_broker-client-1.28.3/lib/pact_broker/client/cli/custom_thor.rb:15:in `start' /pact/lib/pact/cli.rb:60:in `publish' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start' bin/pact:15:in `<top (required)>'``` It doesn?t make sense it can?t find the `bin/pact` binary seeing as it previously ran and gave me some output. The `publish` command also works when I pass the `--help` option and it shows me the correct interface for running the command.

joel.whalen
2020-07-29 21:41
Ok? ignore the above error, you are all witnessing a front-end developer learn how to do backend-type stuff. I wasn?t reading the `--help` output correctly? I forgot to specify the `pacts` directory. Now I?ve got: ``` # Publish Pacts cart-service-publish-pacts: container_name: cart-service-publish-pacts image: pactfoundation/pact-cli:0.11.3.0 environment: PACT_BROKER_TOKEN: $PACT_BROKER_TOKEN PACT_BROKER_BASE_URL: $PACT_BROKER_BASE_URL CONSUMER_APP_VERSION: $CONSUMER_APP_VERSION CONSUMER_VERSION_TAG: $CONSUMER_VERSION_TAG volumes: - $WORKING_DIR/cart_service/pacts:/pact/pacts command: > publish /pact/pacts --consumer-app-version $CONSUMER_APP_VERSION --broker-base-url $PACT_BROKER_BASE_URL --broker-token $PACT_BROKER_TOKEN --tag-with-git-branch --verbose``` but this is failing on the git branch like so ```PactBroker::Client::Error - Could not determine current git branch using command `git name-rev --name-only HEAD`. Errno::ENOENT No such file or directory - git``` Does `git` need to be added to the docker container to support the `--tag-with-git-branch` flag?

joel.whalen
2020-07-29 21:48
Created a dockerfile with git installed like so ```FROM pactfoundation/pact-cli:0.11.3.0 RUN apk update RUN apk add git``` produced: ```fatal: not a git repository (or any of the parent directories): .git PactBroker::Client::Error - Command `git name-rev --name-only HEAD` didn't return anything that could be identified as the current branch.``` I?m guessing I?m not setting up volumes correctly

joel.whalen
2020-07-29 22:11
Alright I just made it an env variable instead of using the git option. We are coming along nicely now! Thanks for letting me rubber duck in this channel? will leave these messages up for anyone finding the same issues.

matt.fellows
2020-07-29 23:56
You probably need to mount the local git directory also

matt.fellows
2020-07-29 23:56
e.g. (assuming within the container the default path is `/pact` `- $WORKING_DIR/.git:/pact/.git`

matt.fellows
2020-07-29 23:57
You?re right, that image probably should have git in it by default


ranjanayush03
2020-07-30 05:59
Hi team like I was able to start pact-broker service with mysql server by pulling the image but now I have installed MySQL server on my machine and created a database named pact_broker and trying to connect to it but was unable to .

bethskurrie
2020-07-30 06:00
You can't use localhost to access the database

bethskurrie
2020-07-30 06:00
that's *your* localhost

bethskurrie
2020-07-30 06:00
not the localhost of the pact broker container.

ranjanayush03
2020-07-30 06:00
Here I am trying to use MySQL server running on my machine

ranjanayush03
2020-07-30 06:00
Can't I use that

bethskurrie
2020-07-30 06:01
Imagine you are the container

bethskurrie
2020-07-30 06:01
what is localhost to the pact broker container?

ranjanayush03
2020-07-30 06:02
It will be inside the container thel ocalhost

bethskurrie
2020-07-30 06:02
bingo

bethskurrie
2020-07-30 06:02
give it the IP of your machine

bethskurrie
2020-07-30 06:02
and make sure MySQL is accessible from an external host

ranjanayush03
2020-07-30 06:02
Okay will try that thank you Beth.

bethskurrie
2020-07-30 06:03
also, are you sure you want to use the dius image?

bethskurrie
2020-07-30 06:03
the pactfoundation one is smaller

ranjanayush03
2020-07-30 06:03
Ohh like that will check that then.

bethskurrie
2020-07-30 06:03
have you read the "which one should I use?" section?

bethskurrie
2020-07-30 06:03
also, I don't recommend using MySQL

bethskurrie
2020-07-30 06:03
it's optimised for use on Postgres.

ranjanayush03
2020-07-30 06:04
I guess no.. I will go through that section

ranjanayush03
2020-07-30 06:04
Actually now I have installed MySQL on my machine and trying to use that


ranjanayush03
2020-07-30 06:04
To get the dius image running

bethskurrie
2020-07-30 06:05
Why aren't you using a MySQL image on the docker compose?

bethskurrie
2020-07-30 06:05
it would be much easier

bethskurrie
2020-07-30 06:06
```mysql: image: mysql:5.7.28 command: --default-authentication-plugin=mysql_native_password environment: MYSQL_ROOT_PASSWORD: pact_broker MYSQL_DATABASE: pact_broker MYSQL_USER: pact_broker MYSQL_PASSWORD: pact_broker ports: - "3306:3306"```

ranjanayush03
2020-07-30 06:06
Thanks for sharing Beth I tried that it worked for me..

ranjanayush03
2020-07-30 06:07
But now I just wanted to use mysql running on my machine

bethskurrie
2020-07-30 06:07
ok!

ivan.lombardiborgia
2020-07-30 06:52
has joined #pact-broker

ranjanayush03
2020-07-30 06:57
Hi @bethskurrie for me it is showing can't connect to MySQL server on the IP address.

bethskurrie
2020-07-30 06:58
Your MySQL server probably can't be accessed from outside your machine.

bethskurrie
2020-07-30 06:58
You'll need to get someone from your company to help you with that

ranjanayush03
2020-07-30 06:59
Okay sure , but we have to follow the same steps for it..

bethskurrie
2020-07-30 06:59
I don't understand what you mean.

bethskurrie
2020-07-30 07:00
Let me google it for you.


ranjanayush03
2020-07-30 07:00
The steps for setting it on MySQL I meant . Sorry for not communicating properly..

ranjanayush03
2020-07-30 07:00
In the docker-compose file

bethskurrie
2020-07-30 07:00
Why would it be any different?

bethskurrie
2020-07-30 07:01
You just need to make the database accessible to the container.


ranjanayush03
2020-07-30 07:01
Yeah Beth I will check the link thanks for sharing.

ranjanayush03
2020-07-30 07:02
Sorry for bothering you again..

bethskurrie
2020-07-30 07:03
I'm happy to answer questions about the pact broker, but I'm afraid I can't teach you how to use docker/docker-compose/MySQL. You'll need to get someone in your company to help you with that.

ranjanayush03
2020-07-30 07:04
Han sure Beth will try to establish the connection in mysql

bethskurrie
2020-07-30 11:19
Did you get it working @ranjanayush03?

matias.waterloo
2020-07-30 12:18
has joined #pact-broker

ranjanayush03
2020-07-30 13:37
@bethskurrie i tried many scenarios on how to allow remote access to the MySQL server but I think there is some restriction to access those ports or something related to firewall as it was not allowing me to do any changes on that .need to consult with someone on that.

joel.whalen
2020-07-30 16:21
oh cool I?m glad I found something to help :slightly_smiling_face:

bethskurrie
2020-07-31 01:03
@joel.whalen I've put out a new version of the pact-cli (0.11.4.0) with git installed and a fix for that class not found error. Can you try it out and let me know how it goes?

bethskurrie
2020-07-31 01:34
Actually, grab 0.11.4.1 - I've updated the entrypoint so that you can set the working directory to anywhere.

bethskurrie
2020-07-31 01:35
```docker run --rm \ -w ${PWD} \ -v ${PWD}:${PWD} \ -e PACT_BROKER_BASE_URL \ -e PACT_BROKER_USERNAME \ -e PACT_BROKER_PASSWORD \ pactfoundation/pact-cli:0.11.4.1 \ publish \ ${PWD}/example/pacts \ --consumer-app-version fake-git-sha-for-demo-$(date +%s) \ --tag-with-git-branch```

matt.fellows
2020-07-31 02:01
Oh cool, thanks Beth!

matt.fellows
2020-07-31 02:02
Also. Do I need to have that chat with you again! :stuck_out_tongue:

bethskurrie
2020-07-31 03:05
Totally not working.

bethskurrie
2020-07-31 03:06
It's not work. Nobody is paying me.

matt.fellows
2020-07-31 03:07
That?s what I tell Steph

matt.fellows
2020-07-31 03:08
> ?You?re always working until late at night? Don?t mistake me doing things _at night_ in the same seat, same desk and same IDE as work i do _during the day_

bethskurrie
2020-07-31 03:10
Totally different.

bethskurrie
2020-07-31 05:35
Do you need to set it up on your local machine? What about running it on Heroku?


joel.whalen
2020-07-31 16:56
You work fast! However, I?m still getting `fatal: not a git repository (or any of the parent directories): .git` after upgrading to 0.11.4.1 My `docker-compose.yml`: ``` # Publish Pacts cart-service-publish-pacts: container_name: cart-service-publish-pacts image: pactfoundation/pact-cli:0.11.4.1 environment: PACT_BROKER_TOKEN: $PACT_BROKER_TOKEN PACT_BROKER_BASE_URL: $PACT_BROKER_BASE_URL CONSUMER_APP_VERSION: $CONSUMER_APP_VERSION CONSUMER_VERSION_TAG: $CONSUMER_VERSION_TAG CONSUMER_APP_TAG: $CONSUMER_APP_TAG volumes: - $WORKING_DIR/cart_service/:$WORKING_DIR/cart_service command: > publish $WORKING_DIR/cart_service/pacts --consumer-app-version $CONSUMER_APP_VERSION --broker-base-url $PACT_BROKER_BASE_URL --broker-token $PACT_BROKER_TOKEN --tag-with-git-branch``` If I do `${PWD}:${PWD}` as the mounted volume I still get the same issue too, so I don?t think that?s it

joel.whalen
2020-07-31 17:48
I tried removing `.git` from the `.dockerignore` file but that didn?t help either https://github.com/monicahq/monica/issues/589

bzifkin
2020-08-03 16:34
Hey again I am using pact jvm and i am having issues publishing my verification results to the broker. I know that the provider can access the broker b/c if i modify the contract on the consumer side the provider will pick it up and fail....but it doesnt get published

bzifkin
2020-08-03 16:35
This is another classic case of it worked until it didnt....pretty sure the only changes were to the consumer side since the publish last worked....would consumer side changes somehow effect this?

bzifkin
2020-08-03 16:39
the error i get when i run `./gradlew pactVerify` is `No service providers are configured`

bzifkin
2020-08-03 16:40
this is my gradle file in the directory that runs the tests: ```pact { publish { pactBrokerUrl = "http://pact.us-central1.stage.xxxxxx.com/" } }```

bzifkin
2020-08-03 16:40
this was working previously....i tried adding the serviceProviders{} closure but got a different error....going to try that again if yall think that would be best....just dont get why it would have suddenly stopped working

bzifkin
2020-08-03 18:29
does anyone have any ideas?

bzifkin
2020-08-03 20:20
yeah this is bizarre - itll publish results when it fails to set the state

bzifkin
2020-08-03 20:21
saying verification failed, obviously, but when i change the state function to work, it doesnt publish verification results

bzifkin
2020-08-03 21:01
ok so im suuuuuuuuuuuper stumped....i put a breakpoint in InteractionRunner.java where it checks to see if publishing is enabled When i break method that creates the provider state (adding a field to the object that should be null) then its set to publish the results. But when the provider state method works (field is actually null) it is somehow not enabled anymore

bzifkin
2020-08-03 21:01
i'd be super grateful if someone has insight on this

phil.endsley
2020-08-03 21:02
Don't have anything specific for you atm, but you'll probably get more targeted help on #pact-jvm since this seems like a Gradle/java issue

bzifkin
2020-08-03 21:03
ok, yeah wasnt sure which one was correct, ill try it out there

bzifkin
2020-08-03 21:04
thanks

phil.endsley
2020-08-03 21:05
Most (if not all) of the core maintainers are also in Australia. So you might be stuck waiting for them to start their day

bzifkin
2020-08-03 21:06
ah...phooey

bethskurrie
2020-08-03 23:37
@bzifkin it's not a problem with the Pact Broker, it's a problem with the JVM code.

bethskurrie
2020-08-03 23:37
Please ask in #pact-jvm

bethskurrie
2020-08-03 23:38
Sorry I can't help you - I'm not a PactJVM user or maintainer.

bethskurrie
2020-08-03 23:38
My suggestion would be to make sure you're on the latest version of everything.

mamtha.3687
2020-08-04 06:51
What are the prerequisites to run pact-broker as a standalone service instead of running it as a docker service? Any documentation that can help?

bethskurrie
2020-08-04 06:52
Hm.

bethskurrie
2020-08-04 06:52
Docker is really the only supported way

bethskurrie
2020-08-04 06:52
If you need to run it without docker, you'd need to know how to run and administer a ruby service.

bethskurrie
2020-08-04 06:52
That's something you'd have to get ops involved with.

bethskurrie
2020-08-04 06:52
We don't officially support it.

bethskurrie
2020-08-04 06:53
These are the best docs you're going to get: https://github.com/pact-foundation/pact_broker#rolling-your-own

bethskurrie
2020-08-04 06:53
> For production usage, use a web application server like https://www.phusionpassenger.com/ or http://nginx.org/ to serve the Pact Broker application. You'll need to read up on the documentation for these yourself as it is beyond the scope of this documentation. See the https://github.com/pact-foundation/pact_broker/wiki/Configuration#running-the-broker-behind-a-reverse-proxy for instructions on using a reverse proxy with SSL.

mamtha.3687
2020-08-04 08:58
Thanks Beth. Looks like that's a long road.

bzifkin
2020-08-04 14:23
thanks beth

stephen.attard
2020-08-05 07:07
has joined #pact-broker

tim.den.dulk
2020-08-05 08:07
has joined #pact-broker

stephen.attard
2020-08-05 11:42
:wave: What?s the best way to view all the pacts in a single page? The only way we?ve figure it out is to use `?page=1&pageSize=1000` at the end of the URL

rafael.espillaque
2020-08-05 17:01
Am I understanding this correctly? Do we need to enable pending pacts when verifying contracts? Or is it when publishing?

phil.endsley
2020-08-05 17:04
In order to use the pending pacts feature, it needs to be enabled on the broker itself. The feature is "used" by the provider when verifying

rafael.espillaque
2020-08-05 17:05
I can?t find how to enable it in the broker. is it always enabled in http://pactflow.io ?

rafael.espillaque
2020-08-05 17:06
thanks btw!

rafael.espillaque
2020-08-05 17:07
I?m trying to follow https://github.com/DiUS/pact-jvm/tree/master/provider/maven#pending-pact-support-version-410-and-later but those xml tags don?t seem to match what I see in the real pom file

phil.endsley
2020-08-05 17:08
We use the open source broker, so I can't help you there :disappointed: Sorry

rafael.espillaque
2020-08-05 17:09
and do you happen to remember how to do it on-prem?


rafael.espillaque
2020-08-05 17:10
I guess it?s always enabled in http://pactflow.io

phil.endsley
2020-08-05 17:10
For on-prem, you need to add the environment variable: `PACT_BROKER_FEATURES: pacts_for_verification`

rafael.espillaque
2020-08-05 17:10
my real problem is with the maven documentation

rafael.espillaque
2020-08-05 17:10
thank you Phil

phil.endsley
2020-08-05 17:12
Yeah...We use the `@PactBroker ` annotation for our jvm tests...The only thing I can think of is the documentation shows everything wrapped in `<pactBroker>` tags, but I don't see that in yours. Not sure if that's a problem or not, I don't use maven

rafael.espillaque
2020-08-05 17:12
are you who created https://github.com/DiUS/pact-jvm/issues/1134 ? I agree with it!

rafael.espillaque
2020-08-05 17:13
when using the @PactBroker annotation, how do you inject the authentication token or the current git branch?

phil.endsley
2020-08-05 17:14
yeah. I think it still needs to be clarified, but it works differently than how I thought it did when I wrote it

phil.endsley
2020-08-05 17:15
You can set them by using system properties, and they get parsed when the tests run


rafael.espillaque
2020-08-05 17:16
oh nice

phil.endsley
2020-08-05 17:16
That list needs to be updated, but you can also configure the consumerVersionSelectors via system properties if you want

rafael.espillaque
2020-08-05 17:17
I?d appreciate if you could share an example of the sysvars that you are actually using :pray:

phil.endsley
2020-08-05 17:22
About that... :sweat_smile: We don't use them ourselves... We don't require auth for our broker, since it's only accessible from our lan. For the current branch, we don't have the best workflow yet. I'm assuming you mean how to inject the consumer feature branch name? For verifying consumer feature branches, we manually add the branch we're testing against, then remove it before merging. We also have two others that are always there (dev, and prod).

phil.endsley
2020-08-05 17:23
The manual steps are a little tedious, but since we're using pending pacts and wip pacts, the provider verifies against the feature branch when it's merged into our main branch

phil.endsley
2020-08-05 17:23
Without extra config

rafael.espillaque
2020-08-05 17:24
ah nice

rafael.espillaque
2020-08-05 17:24
thanks anyway again!

matt.fellows
2020-08-05 22:42
@rafael.espillaque pending pacts is enabled on Pactflow by default. I think in the next week it will also be enabled by default on the OSS Broker


matt.fellows
2020-08-05 22:43
Unfortunately I don?t know the JVM ecosystem well enough to help with specifics

matt.fellows
2020-08-05 22:43
It may not be exposed to the Maven interface yet

bethskurrie
2020-08-06 04:36
Best to ask in #pact-jvm @rafael.espillaque

bethskurrie
2020-08-06 04:36
@stephen.attard that's the only way

bethskurrie
2020-08-06 04:38
You could raise a feature request to have it store the page size somewhere (cookie?)


stephen.attard
2020-08-06 06:53
Thanks Beth, will do.

stephen.attard
2020-08-06 07:09
https://pact.canny.io/feature-requests/p/allow-single-page-view-of-all-the-pacts Feel free to add more detail or re-word as makes sense to you.

bethskurrie
2020-08-06 07:17
ta!

rafael.espillaque
2020-08-06 10:29
thanks, but I?ve realised I?m actually using junit for verifications, so I was able to configure it in the annotation instead of maven

praneethkumar
2020-08-06 11:17
Does anyone know if we have a non root version of pactbroker CLI ? Currently we facing an issue with root access while deploying it in our PaaS environment. Thanks Praneeth

matt.fellows
2020-08-06 11:19
Does it require root access?

matt.fellows
2020-08-06 11:20
Can you please describe the issue in more detail and what would need to change for the CLI? Ideally, if you can specify exactly what needs to change in https://github.com/pact-foundation/pact-ruby-cli to make it work, an issue raised there is the best idea

matt.fellows
2020-08-06 11:20
I don?t think it needs root access to run, but I may be mistaken

sam.tavakoli
2020-08-06 12:30
has joined #pact-broker

rafael.espillaque
2020-08-06 18:42
wip-pacts are confusing :weary: My consumer has published a pact tagged with `test` (name of the branch) My provider is verifying with pendingPacts and wipPacts enabled (using pact-jvm) and also `providerTags=master` I was expecting the `test` pact to be a pending pact for the provider but it seems that only the `master` pact is a pending pact. The only way I can make it verify the `test` pact is by using `-Dpactbroker.consumerversionselectors.tags=master,*test*` where test is the name of the branch that currently is being built (I had to name it the same than the consumer). Basically, I?m able to prove that strategy 2 works but can?t make strategy 3 work https://docs.pactflow.io/docs/workshops/ci-cd/workshop/verifying-feature-pacts/

rafael.espillaque
2020-08-06 18:43
also `fallbackTag` doesnt seem to be available for `pact-jvm junit` (but shouldn?t be a problem I guess)

phil.endsley
2020-08-06 18:50
`fallbackTag` and some other attributes ( `consumer` ...not sure if there are more?) aren't supported yet. Can't remember if I opened an issue or not...

phil.endsley
2020-08-06 18:55
> wip-pacts are confusing Agree :slightly_smiling_face: I've been trying to solidify what I thought was confusing and how to better explain it, and use that for feedback here. Haven't quite solidified my thoughts yet though Does the pact tagged with `test` have any successful verifications in pactbroker? Any successful verifications against the provider tagged with `master`? As soon as there is a successful verification with `providerTags` published, it is no longer a pending pact, and won't be included

rafael.espillaque
2020-08-06 18:57
nop, I have a `master` pact that has been verified but the `test` pact not yet

phil.endsley
2020-08-06 18:58
Do you have a provider version in pactbroker tagged with `master`?

rafael.espillaque
2020-08-06 19:00
I think I don?t, I can only see tags below the consumer version

rafael.espillaque
2020-08-06 19:01
I?m sure I don?t :thinking_face:

phil.endsley
2020-08-06 19:01
Yeah, so that's what the issue is. Pact Broker calculates pending pacts by using tags on provider versions. This is why you have to specify the `providerTags` property when fetching wip/pending pacts. This specific thing has caused issues for me more than once

rafael.espillaque
2020-08-06 19:02
but I?m specifying it

rafael.espillaque
2020-08-06 19:02
but I can?t see the tags in the broker

phil.endsley
2020-08-06 19:04
When you publish verification results, you can specify the provider version and tag. In jvm land, you can specify the `pact.provider.version` and `pact.provider.tag` system properties to do this. Then, when your verification results are published, it will publish them with that data as well.

rafael.espillaque
2020-08-06 19:04
ah, so it?s `pact.provider.tag` the one I?m missing

rafael.espillaque
2020-08-06 19:05
let me try!!

phil.endsley
2020-08-06 19:05
Pending pacts are calculated on the broker side. It does that by looking for provider versions tagged with whatever you specify with the `providerTags` property, and will give you any pacts that have not been successfully verified by it (I think...this is how I've internalized it, not sure if that's how it's actually implemented). So for it to work, you have to have a provider version in pact broker that is tagged with whatever you specify with `providerTags`. If it doesn't find the tag, it won't return any

phil.endsley
2020-08-06 19:07
If you manually tag one of your provider results with `master`, I would expect it to start working. You can do this through the broker's build in API client

phil.endsley
2020-08-06 19:09
> ah, so it?s `pact.provider.tag` the one I?m missing And to clarify, adding this will make it so your provider version is tagged with that value. It won't do anything for pending/wip pacts

rafael.espillaque
2020-08-06 19:40
done!

rafael.espillaque
2020-08-06 19:40
thank you Phil as always!

phil.endsley
2020-08-06 19:40
:tada::tada::tada:

jarmy
2020-08-06 22:28
I ran into a custom SSL certificate issue with the `pact-broker-client` when calling `create-webhook` and realized I filed the https://github.com/pact-foundation/pact-ruby-standalone/issues/57 against the `pact-ruby-standalone` repo and not the broker-client. Should I have filed it against the `pact-broker-client` repo?

bethskurrie
2020-08-07 00:45
Yes, it should be in the pact_broker-client project @jarmy but it'll do

bethskurrie
2020-08-08 04:55
@rafael.espillaque you can achieve the same thing as the fallback tag by just including a new selector for the other tag.

bethskurrie
2020-08-08 04:55
If it doesn't exist, it just won't be included.

bethskurrie
2020-08-08 04:57
And they'll be de-duped anyway, so even if you have { tag: "master'}, {tag: ENV['BRANCH']}` and the branch is master, you'll still only verify the master pact once.

coduo123
2020-08-10 11:14
has joined #pact-broker

vit.barabash
2020-08-11 06:52
has joined #pact-broker

bret.mcclory
2020-08-11 19:05
has joined #pact-broker

praneethkumar
2020-08-12 12:30
Hi , I am a little bit confused about using the can I deploy in our pipeline . We have a pact broker installed in our open shift environment and we were able to publish & verify the contracts. Now we want to integrate can I deploy within the CI . Do we need to install pact cli in open shift inorder to do this ? Praneeth

sklein
2020-08-12 13:15
I spin up the cli in a docker container as a portion of our pipeline that runs prior to any kube/helm deployment steps. Failed `can-i-deploy` terminates the pipeline prevented the deployment steps from occurring. So in my case the requirement is that docker exists on whatever build agent/system is being used to run the cicd pipeline (jenkins in my case)

joel.whalen
2020-08-12 14:47
We have the same setup, although I have yet to get to the `can-i-deploy` step.

bret.mcclory
2020-08-12 16:57
Beginner Pact (Broker) question: I've been a bit tripped up by examples I've seen in the tutorials/workshops. On the consumer side, *Pact _file_ artifacts are created by the tests*, and then you've gotta explicitly publish those artifacts to a broker as an additional step (i.e. CI step/task.) But on the provider side (at least for Pact-Net, and other implementations that I've glanced at) the pattern is to have the Pact verifier *directly publish the results to a broker during test execution* -- i.e. no file artifacts, no additional build steps. I'm wondering if there's a reason for this asymmetry? Is this how most folks use the framework, or do people adopt other approaches here? (I think I prefer having explicit build steps for publication, for increased visibility/auditability, rather than having it occur as a side effect of test execution and having those details buried in log output from a test task.) (My current workaround is to execute provider verification tests in their own build step rather than together with my other provider tests. But this asymmetry between consumer/provider is still a bit weird to me.)

joel.whalen
2020-08-12 17:56
There is only 1 contract file between 2 participants; why would the provider need to write a file?

bret.mcclory
2020-08-12 17:58
The verification results -- would nice to output those to a file and explicitly publish them to the broker (as a standalone step). Seems like that's an option when using the standalone pact-provider-verifier CLI tool, but not when using the language-specific implementations that wrap the Ruby core (like Pact-Net, and probably others.)

joel.whalen
2020-08-12 18:04
Oh yeah we use the CLI tool from the official image here for verification https://hub.docker.com/r/pactfoundation/pact-cli I don?t separate the steps though because to me it?s all part of the same job, I don?t see a good reason to make 2 jenkins jobs for verification + publish

bret.mcclory
2020-08-12 18:17
Yeah, that's one option. The technique demonstrated in the workshops is to execute verifications using your provider's normal testing framework. (For Pact-Net tutorials, it's just another xUnit test, that happens to process marshal the Pact Ruby core to execute & publish verifications.) I do appreciate the simplicity of executing verification tests using the same test framework / tooling as other provider tests (i.e. unit tests). Less friction for local development. Just wish it had an option to output those verification results to file artifacts instead of doing the publication during test execution.

joel.whalen
2020-08-12 18:19
You want the broker to be handling verification results though. I mean I suppose you could look at them locally, but that seems redundant.

bret.mcclory
2020-08-12 18:51
I don't think it's redundant? During development of provider, I want to run verifications locally (no publishing to broker) to get fast feedback and see if I've implemented a feature correctly (i.e. successful Pact verfication.) If not, I'd like to see detailed output from the verifier about which interaction(s) failed. On CI build, I want those verification results published back to the broker. The thing that I find (mildly) strange about the Pact verifier behavior (when using the language-specific tooling that wraps the Pact core instead of the standalone CLI) is that it wants to publish those verification results immediately during test execution -- no option to write results to an intermediate file(s) and later publish them to the broker. Anyway, I think I can make this work the way I want, it's just a little confusing getting started.

joel.whalen
2020-08-12 18:55
Oh! I see, yes that would be very helpful! Actually running into that issue now trying to guide some coworkers to their own pact verification solution.

praneethkumar
2020-08-12 21:23
We are getting the below error while trying to deploy CLI in our open shift environment

abubics
2020-08-13 00:29
It is asymmetrical in the sense that there's no artifact alongside the result of the provider verification. On the consumer pact test side, you run tests to get a result and an artifact (pact file). On the provider side you take the artifact to provide test input, and get a result, but no artifact.

abubics
2020-08-13 00:32
As for publishing verification results, it's a pact broker workflow feature, and a kind of secondary level of capability (over asserting the contract). If you got the contract from a broker, it makes sense to automatically send the result back to the same (but you may not always want to). Regardless of whether that is ideal, I think that's where the intent came from :slightly_smiling_face:

abubics
2020-08-13 00:34
As for publishing pact files to a broker, many of the libraries (e.g. the gradle plugin) do that automatically, and you just have to tell it where the broker lives. I think everything is moving towards not having to write the 2 steps yourself.

bethskurrie
2020-08-13 04:02
@bret.mcclory @abubics the reason the verifications get published as part of the verification tests themselves is that most build/testing task runners (rake, maven etc) will stop as soon as they get a failure. If the results publishing was a separate step afterwards, then the failure results would never get published.

bethskurrie
2020-08-13 04:04
@joel.whalen ^^

bethskurrie
2020-08-13 04:04
@bret.mcclory every one of the languages that wraps the standalone should provide a configuration to say whether or not to publish the results.

bethskurrie
2020-08-13 04:04
This flag should only ever be on in CI.

bethskurrie
2020-08-13 04:05
If you have found a wrapper language that does not expose this toggle, then please raise an issue.

bethskurrie
2020-08-13 04:06
In fact, whether or not it wraps the standalone is irrelevant - every pact implementation should expose the publishing toggle. If it doesn't, someone needs to fix that, because results should never be published from a local machine.

bethskurrie
2020-08-13 04:06
@joel.whalen can you explain more about "their own pact verification solution"? What issues are you facing?

bethskurrie
2020-08-13 04:08
If you think that it would be useful to have the verification results as a local artifact as well as publishing them, then you can raise a feature request at https://pact.canny.io

bethskurrie
2020-08-13 04:09
@praneethkumar your language is confusing.

bethskurrie
2020-08-13 04:09
You don't deploy a CLI.

bethskurrie
2020-08-13 04:11
You deploy a service (the Pact Broker) and you execute a command line interface (the Pact Broker *Client*) to connect to the service.

bethskurrie
2020-08-13 04:11
The Pact Broker *client* is the tool that has can-i-deploy.

bethskurrie
2020-08-13 04:11
It sounds like you're trying to execute the Pact Broker docker container as part of your build, and that doesn't make sense at all.

bethskurrie
2020-08-13 04:12
You don't have to use Docker to use can-i-deploy. (though it is the easiest way). You can install the pact-ruby-standalone, which is a standalone executable that can be downloaded for any platform.


bethskurrie
2020-08-13 04:15
Have you done the CI/CD workshop? That will help https://docs.pactflow.io/docs/workshops/ci-cd/

bethskurrie
2020-08-13 04:16
Here is an example of how to call `can-i-deploy` using the Pact CLI docker image https://github.com/pactflow/example-consumer/blob/master/Makefile#L51

bethskurrie
2020-08-13 04:17
@bret.mcclory here is the flag for Pact-Net for publishing/not publishing the results https://github.com/pact-foundation/pact-net#publishing-provider-verification-results-to-a-broker

bethskurrie
2020-08-13 04:18
`PublishVerificationResults`

sklein
2020-08-13 13:16
What are general feels about baking in some functionality that mirrors [`wait-for`](https://github.com/eficode/wait-for) into the `pact-cli` docker image so that you can allow the provider adequate time to initialize before running `verify` against it. At the moment I'm building a separate docker image using `pactfoundation/pact-cli:latest` as the base image and copying in the `wait-for.sh` script in order to accomplish this within my provider verification steps for python providers. I'm then spinning up the cli inside of my docker-compose.yml using the following: ```pact: ... other compose stuff entrypoint: "./wait-for.sh provider:8001 -t 60" command: > -- /pact/entrypoint.sh verify ... all the various command line flags depends_on: - provider``` Thoughts, feels, comments?

bret.mcclory
2020-08-13 13:17
Thanks Beth! I'm aware of (and am using) the PublishVerificationResults option. > If the results publishing was a separate step afterwards, then the failure results would never get published. I hadn't really considered that; makes sense. My desire to have publish occur as a separate build step --- which I now see is maybe not a good idea and would bring its own challlenges -- was to make publication activity more visible/auditible during CI builds. As it is right now, it happens as a side effect during a test run -- a run that includes all the other (unit) tests for my SUT. Plus, my CI runner eats the test result log output on success, so I have zero visibility into what (if anything) is being published during those builds. This seems especially problematic for pending/wip Pact verification, where the verification may fail but not cause a test failure. I have to poke around in the broker to see those details/the outcome. I'm addressing those issues by breaking out my pact tests into their own discrete CI build step with different logger settings. Thanks again!

matt.fellows
2020-08-13 13:27
Seems sensible. I seemed to recall the verifier having an inbuilt retry/delay but I may be wrong

matt.fellows
2020-08-13 13:28
I think ideally it could be made to live in the verifier directly if it was useful to others

joel.whalen
2020-08-13 14:03
@bethskurrie As for cicd pipelines stopping at failures, that can actually be configured in Jenkins. We can tell Jenkins to ignore failures of certain jobs so it can move on to publishing, and then have a switch in the publish job that if the verification job before it failed THEN stop the pipeline. A bit more work, but it?s doable. As for doing verification for the first time (I?m helping another team with first-time setup of Pact), it would be useful to do verification *only locally without publishing results to the broker.* So we can troubleshoot, see what it looks like, run it a whole bunch of times, etc without affecting the verification status of anything else in the broker. Also, having the `Read/Write` API token for Pactflow on developer machines is said to be bad practice, so this would align with that.

joel.whalen
2020-08-13 18:58
Here?s an example of an error that came from a developer?s machine that didn?t really *need* to be published to Pactflow:

abubics
2020-08-14 00:03
> it would be useful to do verification *only locally without publishing results to the broker* That's what it should do by default . . . :thinking_face:

bethskurrie
2020-08-14 00:05
@joel.whalen I'm still confused - why are results being published from a local machine?

bethskurrie
2020-08-14 00:05
It's turned off by default, so it seems that it's been hardcoded to be "on"

bethskurrie
2020-08-14 00:06
The docs should clearly state that the flag should only be turned on in CI - is that missing in the docs you've been reading?

bethskurrie
2020-08-14 00:06
> Also, having the `Read/Write` API token for Pactflow on developer machines is said to be bad practice, so this would align with that.

bethskurrie
2020-08-14 00:07
Exactly.

bethskurrie
2020-08-14 00:08
It's already built in

bethskurrie
2020-08-14 00:09
@sklein @matt.fellows

bethskurrie
2020-08-14 00:09
```[--wait=SECONDS] # The number of seconds to poll for the provider to become available before running the verification```

matt.fellows
2020-08-14 00:10
I remembered something being there

matt.fellows
2020-08-14 00:10
but that is a bit different I think

matt.fellows
2020-08-14 00:11
will it retry until it is up? or is it just an arbitrary sleep?

bethskurrie
2020-08-14 00:11
it will poll until it's up

matt.fellows
2020-08-14 00:11
cool

bethskurrie
2020-08-14 00:12
"The number of seconds to poll for the provider to become available"


bethskurrie
2020-08-14 00:15
> my CI runner eats the test result log output on success, This is very weird and unhelpful! There's a lot of output that tells you which pacts are being verified (for which tags, whether they're pending etc). Is that normally visible?

ranjanayush03
2020-08-14 04:05
I was going through the webhooks template library in the docs , so as we are using Jenkins as a CI/CD tool so can I get a template for triggering builds for any event that is associated with the consumer and provider whether it be publishing or verifying.. Or is it the same as Travis CI one that has been provided there ..

matt.fellows
2020-08-14 07:10
It would be a different payload body almost certainly

matt.fellows
2020-08-14 07:10
You?d have to look at the Jenkins docs to see if there was a specific format it needed


andrea.spina
2020-08-14 07:36
has joined #pact-broker

sklein
2020-08-14 12:28
Great news! Thanks @bethskurrie

joel.whalen
2020-08-14 13:55
oops my bad then you?re right

joel.whalen
2020-08-14 14:19
forgot that I hard coded that in, we can take it off

bethskurrie
2020-08-14 23:30
@ranjanayush03 can you submit a PR back with an example when you get it working?

scwang
2020-08-17 02:46
has joined #pact-broker

scwang
2020-08-17 02:51
Hi I am running pact-docker file locally but got db errors, I have no problem to connect my db manually. I am wondering how can I fix the issue ? ```postgres_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization postgres_1 | postgres_1 | 2020-08-17 00:07:59.059 UTC [1] LOG: starting PostgreSQL 12.4 (Debian 12.4-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit postgres_1 | 2020-08-17 00:07:59.075 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 postgres_1 | 2020-08-17 00:07:59.075 UTC [1] LOG: listening on IPv6 address "::", port 5432 postgres_1 | 2020-08-17 00:07:59.085 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" postgres_1 | 2020-08-17 00:07:59.154 UTC [25] LOG: database system was shut down at 2020-08-17 00:07:55 UTC postgres_1 | 2020-08-17 00:07:59.160 UTC [1] LOG: database system is ready to accept connections pact-broker_1 | Puma starting in single mode... pact-broker_1 | * Version 3.12.6 (ruby 2.6.6-p146), codename: Llamas in Pajamas pact-broker_1 | * Min threads: 0, max threads: 16 pact-broker_1 | * Environment: production pact-broker_1 | 2020-08-17 02:50:55.084377 I [10:47074060966420] pact-broker -- PACT_BROKER_DATABASE_URL= pact-broker_1 | 2020-08-17 02:50:55.084439 I [10:47074060966420] pact-broker -- PACT_BROKER_LOG_LEVEL=DEBUG pact-broker_1 | 2020-08-17 02:50:55.084447 I [10:47074060966420] pact-broker -- PACT_BROKER_PORT=9292 pact-broker_1 | 2020-08-17 02:50:55.084453 I [10:47074060966420] pact-broker -- PACT_BROKER_PORT_ENVIRONMENT_VARIABLE_NAME=PACT_BROKER_PORT pact-broker_1 | 2020-08-17 02:50:55.084459 I [10:47074060966420] pact-broker -- PACT_BROKER_SQL_LOG_LEVEL=DEBUG pact-broker_1 | 2020-08-17 02:50:55.084618 I [10:47074060966420] pact-broker -- Connecting to database with config: {:adapter=>"postgres", :user=>"postgres", :password=>"*****", :host=>"127.0.0.1", :database=>"pact_broker", :port=>5432, :encoding=>"utf8", :sql_log_level=>:debug, :log_warn_duration=>5.0} pact-broker_1 | ! Unable to load application: Sequel::DatabaseConnectionError: PG::ConnectionBad: could not connect to server: Connection refused pact-broker_1 | Is the server running on host "127.0.0.1" and accepting pact-broker_1 | TCP/IP connections on port 5432? pact-broker_1 | bundler: failed to load command: puma (/pact_broker/vendor/bundle/ruby/2.6.0/bin/puma) pact-broker_1 | Sequel::DatabaseConnectionError: PG::ConnectionBad: could not connect to server: Connection refused pact-broker_1 | Is the server running on host "127.0.0.1" and accepting pact-broker_1 | TCP/IP connections on port 5432? ```

matt.fellows
2020-08-17 02:52
From the perspective of the pact-broker container, is the database running on IP `127.0.0.1` ?

matt.fellows
2020-08-17 02:52
(hint: no)

matt.fellows
2020-08-17 02:53
`127.0.0.1` is loopback address. So unless you?re running the database on the loopback address within the pact-broker container, it won?t work

matt.fellows
2020-08-17 02:54
There is a docker compose example in the repository that shows how to connect it to another container. IF it?s not a container, then you?ll need the actual addressable IP adress of the database (that may be the IP address of your host machine)

scwang
2020-08-17 02:58
thanks , I will try my ip address

scwang
2020-08-17 03:31
my pact broker is up and running but I keep getting this error ```PUT JSON request failed with status HTTP/1.1 400 Bad Request Publishing 'GetCampaignsConsumer-CMAPIProvider.json' ... Failed```

scwang
2020-08-17 03:31
can you please help ?

matt.fellows
2020-08-17 03:32
Your sending a bad request

matt.fellows
2020-08-17 03:33
Sent the right one :rolling_on_the_floor_laughing:

matt.fellows
2020-08-17 03:33
Please share your code. I can't tell you why your request is bad without it

scwang
2020-08-17 03:35
```pact { publish { pactDirectory = 'C:\\Scott\\ContractTest\\target\\pacts' // defaults to $buildDir/pacts pactBrokerUrl = 'http://localhost:9292/' } }```

scwang
2020-08-17 03:35
I am using the gradle plugin to publish the contracts to pact broker

scwang
2020-08-17 03:36
Publishing 'GetCampaignsConsumer-CMAPIProvider.json' ... Failed

scwang
2020-08-17 05:27
Hi I found if the provider name of contract name has space in between, I will have 400 Bad Request error when uploading to pact broker, it works after I removed spaces , is it a expected behavior ?

uglyog
2020-08-17 05:29
No, spaces are ok in names. What are you using to upload the pact files?

scwang
2020-08-17 05:31
I am using gradle plugin


uglyog
2020-08-17 06:23
Have you run it with debug logging?


scwang
2020-08-17 06:28
this is what I got

scwang
2020-08-17 06:28
```PUT JSON request failed with status HTTP/1.1 400 Bad Request Publishing 'Copy Draft Campaigns Consumer-CM API Provider.json' ... Failed PUT JSON request failed with status HTTP/1.1 400 Bad Request Publishing 'Get Campaigns Consumer-CM API Provider.json' ... Failed FAILURE: Build failed with an exception. * What went wrong: One or more of the pact files were rejected by the pact broker * Try: Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Exception is: org.gradle.api.GradleScriptException: One or more of the pact files were rejected by the pact broker at au.com.dius.pact.provider.gradle.PactPublishTask.publishPacts(PactPublishTask.groovy:75) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:46) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26) at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:801) at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:768) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:131) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77) at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59) at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101) at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44) at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91) at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54) at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46) at org.gradle.execution.taskgraph.LocalTaskInfoExecutor.execute(LocalTaskInfoExecutor.java:42) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:277) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:262) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:135) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.execute(DefaultTaskPlanExecutor.java:200) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.executeWithWork(DefaultTaskPlanExecutor.java:191) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.run(DefaultTaskPlanExecutor.java:130) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) * Get more help at https://help.gradle.org```

uglyog
2020-08-17 06:30
What version of Pact-JVM are you using?

scwang
2020-08-17 06:37
```'pact-jvm-consumer', version: '4.0.10'```

uglyog
2020-08-17 06:55
I've used that version with spaces in the names. Try version 4.1.7 to see if it makes a difference

scwang
2020-08-17 06:55
thanks

ziadtawfeek05
2020-08-17 08:16
has joined #pact-broker

matt.fellows
2020-08-17 10:37
Mm sorry that's not too helpful either. Might need to ask in #pact-jvm for more tips

iesmite
2020-08-17 20:32
has joined #pact-broker

jarmy
2020-08-17 21:32
I?ve got a question about pending and WIP pacts. What is supposed to happen if a provider re-runs their verification test against an already detected pending pact?

jarmy
2020-08-17 21:33
Here?s what I?m experiencing. As expected, the first verification failure won?t fail the provider CI build. Successive verification builds then fail. My provider team is running their pact verification tests in their acceptance tests jobs _after_ they?ve deployed to a canary in _each_ environment. If this passes, they?ll do a full deploy. If not, they?ll roll back to the last good version.

phil.endsley
2020-08-18 02:52
I don't think this will work the way you want, at least the way I'm interpreting it. All wip pacts are pending pacts. As long as there are no successful verifications, the provider will still pick them up and run them. However, as soon as a successful verification is published, it is no longer considered wip, and no longer pending. That means in subsequent builds (even if you rebuild the same commit) the wip pact will not be picked up

phil.endsley
2020-08-18 02:54
The way I'm interpreting your scenario, if it passes for the first deployment, the subsequent builds on other environments will not run the wip pacts (because they're not wip anymore). So if they're relying on verifications for each environment, I don't think it would work

sklein
2020-08-18 16:10
Revisiting this here... so as implemented it looks like the wait is configured on the `provider-base-url` , which in my use case is actually the proxy sitting in front of the provider. I really need the wait to be configured for a different url (the actual provider endpoint) because otherwise i just get a `502` from the proxy. @bethskurrie is this something that can be handled with the existing functionality?

jarmy
2020-08-18 20:40
So a pending pact will only be pending until it runs once, and then it will be automatically converted to a non-pending pact?

phil.endsley
2020-08-18 20:43
Until it's successfully verified once. It can fail multiple times and still be pending

phil.endsley
2020-08-18 20:43
But as soon as it is successfully verified, it is no longer pending

jarmy
2020-08-18 20:47
I?ll have to double-check but I don?t think that?s the behavior I experienced. A second failure on a subsequent test run resulted in a failed test. The first verification test, while the pact was unverified, it didn?t cause the test to fail

jarmy
2020-08-18 20:59
OK. I stand corrected.

jarmy
2020-08-18 21:15
Is there a way to put it the pact back into pending state after it?s been verified? Manually

bethskurrie
2020-08-19 00:14
Yes

bethskurrie
2020-08-19 00:14
No.

bethskurrie
2020-08-19 00:15
Can you explain why you'd want to do this?

bethskurrie
2020-08-19 00:15
Why are they doing this instead of using can-i-deploy to check the existing results @jarmy?

bethskurrie
2020-08-19 01:41
Remember that the pending status and WIP pacts are calculated based on the provider tag, so you'll need to ensure that if you're running these tests twice (which I don't recommend!) that you're setting the same provider tag each time.

jarmy
2020-08-19 16:08
It?s a little tricky. They?ve already invested heavily into this infrastructure model and we?re trying to fit pact into it. The provider also has a dependency on ~20 services and the verification test requires some of these services. It?s far easier to run the pact verification on top of a deployment. That said, I?ve been trying to convince them to move the pact verification test into their CI build.

jarmy
2020-08-19 16:14
It has to do with where this service is running their pact verification tests (on top of a canary deployment) and their desire to unblock potentially held up code pushes. They?re a tricky customer.

bethskurrie
2020-08-20 01:51
It sounds like a recipe for disaster!

ranjanayush03
2020-08-20 07:56
@bethskurrie yeah sure

ranjanayush03
2020-08-20 07:56
Figured out a part of it will raise a pr when it's done

matt248
2020-08-20 16:04
has joined #pact-broker

iannsantos8
2020-08-20 18:23
has joined #pact-broker

robert.strehli
2020-08-24 08:20
has joined #pact-broker

robert.strehli
2020-08-24 08:28
Hello guys, I have a short question. Should the pact-broker support v3 pacts like message pacts? I got the failure _`this contract could not be parsed to a v1 or v2 Pact`_ , so there is no support for v3 yet?

matt.fellows
2020-08-24 10:20
It supports it but just doesn't remder

matt.fellows
2020-08-24 10:20
Render*

matt.fellows
2020-08-24 10:23
There may be an issue for it online

robert.strehli
2020-08-24 10:39
ok thanks. I'll have a look


matt.fellows
2020-08-24 11:02
Looks like somebody was going to add it to the OSS but didn?t

matt.fellows
2020-08-24 11:04
we support it in http://pactflow.io but it has a completely different UI so we haven?t back ported that feature into OSS

robert.strehli
2020-08-24 11:24
thanks for pointing me to the issue :slightly_smiling_face::thumbsup:. Than I'll will live with that for now . I also wanted to have a look at pactflow anyway :slightly_smiling_face:

parveensultanauk
2020-08-24 11:33
has joined #pact-broker

matt.fellows
2020-08-24 11:44
no probs

matt.fellows
2020-08-24 11:45
Just in case it wasn?t clear before (I was on mobile). It?s all perfectly functional, it just doesn?t display in the UI

matt.fellows
2020-08-24 11:45
(which is annoying, I know!)

alecgerona
2020-08-25 02:09
has joined #pact-broker

heytaco
2020-08-25 03:57
has joined #pact-broker

heytaco
2020-08-25 03:57
Hi there! My name is HeyTaco!, and you can use me to give people tacos to show your appreciation. My tacos will spread joy through Slack!

ranjanayush03
2020-08-25 08:09
Hello guys actually I was using the pact-provider-verifier cli tool so in the parameter --provider-base-url what should be specified there the endpoint of the provider side which we are actually testing.. and how will it call spin up the actual service to verify the pact against..

alecgerona
2020-08-25 09:06
You actually have to spin up the service yourself and just provide the url to call it via that parameter.

ranjanayush03
2020-08-25 09:10
Okay thank you let me try that...

ranjanayush03
2020-08-25 09:11
And on another note i want to find another ways to give the provider side version so can you help me with that..

alecgerona
2020-08-25 10:14
Version? Aside from the commit short sha?

ranjanayush03
2020-08-26 05:17
Yes thanks Alec for now I figured out providing the version in the test section in build.gradle . test{ systemProperty('pact.verifier.publishResults','true') systemProperty ('pact.provider.version', System.env.BUILD_NUMBER') }

alecgerona
2020-08-26 20:50
Cool. Will note this as well when we implement contract testing for our app.

aforeman
2020-08-26 23:26
has joined #pact-broker

nishtha.kakkar.28
2020-08-27 11:19
has joined #pact-broker

nishtha.kakkar.28
2020-08-27 11:24
Hello guys, i have a question on can-i- deploy and tagging part in CI pipeline.. if i check can i deloy for prod tag on consumer side (it checks against prod version of provider) but the provider is not on production because it is also stuck on can-i-deploy against prod tag( checking against the production version of consumer).. I am kind of stuck in a loop because both are depending on each other to check the can i deploy status

tyler.rasor
2020-08-27 13:29
I think the general pattern we?ve settled into is: * update consumer pact with what you eventually need * _add_ to the provider to fulfill the contract * leave in place (but deprecate) the existing contract-satisfying functionality in the provider * deploy the producer that now satisfies both the *old* and *new* version of your consumer * deploy the consumer * clean up the deprecation in the provider

bethskurrie
2020-08-27 23:51
@nishtha.kakkar.28 you can deploy providers without their consumers

bethskurrie
2020-08-27 23:52
If you're finding that can-i-deploy is complaining about a missing consumer, then you may have a very old version of the Pact Broker, before this was fixed.

bethskurrie
2020-08-27 23:52
What version are you on?

nishtha.kakkar.28
2020-08-28 09:12
@tyler.rasor can u provide more info on this.. what do u mean by leave in place ?

nishtha.kakkar.28
2020-08-28 09:27
@bethskurrie I still haven't gotten there.. i am trying to figure out the flow for CI pipeline.. and we are using pact-1.61.1 version, will this cause any issue?

bheemreddy181
2020-08-28 15:41
Team - Quick question around pact broker - is there a way i can verify two different pact with different SHA?s to see what?s changed

phil.endsley
2020-08-28 15:49
You want to run verifications against two? Or just see a diff between them? Broker has an api for viewing the diffs between 2 pacts. https://pactBrokerHost/pacts/provider/{provider}/consumer/{consumer}/pact-version/{pactVersion1}/diff/pact-version/{pactVersion2} Note that the pact versions here are the SHAs

bheemreddy181
2020-08-28 15:54
Got that - i typically just want to check the diff between two pacts

phil.endsley
2020-08-28 15:54
There's also one for checking against the previous distinct one, if you do that more often. Vs 2 arbitrary versions

phil.endsley
2020-08-28 15:56
When viewing a Pact from the Hal Browser

sairsule
2020-08-30 15:43
I am getting following error when running Pact test on Jenkins. ```2020/08/30 13:50:33 [DEBUG] checking CLI compatibility 2020/08/30 13:50:33 [INFO] checking pact-mock-service within range >= 3.5.0, < 4.0.0 2020/08/30 13:50:33 [DEBUG] running binary pact-mock-service 2020/08/30 13:50:33 [ERROR] CLI tools are out of date, please upgrade before continuing``` Does that mean I need to install Pact_cli on jenkins?

matt.fellows
2020-08-30 21:32
This is a Pact Go issue, right?

matt.fellows
2020-08-30 21:33
Either the Cli isn't on Jenkins or they are too old. The rest of the log would tell you which is the case

sairsule
2020-08-31 04:38
do youthat mean, if its a java proroject, pact-cli is not required?

matt.fellows
2020-08-31 05:50
If you?re explicitly using the Pact CLI commands (e.g. from https://github.com/pact-foundation/pact-ruby-standalone/releases) then you do, but if you?re using Java no

matt.fellows
2020-08-31 05:51
In fact, the only language that I think requires you to manually install the CLI is pact go.

matt.fellows
2020-08-31 05:51
?and I?m going to fix that by making it download it on demand if it?s not available

matt.fellows
2020-08-31 05:51
(or at least, having the option to do so)

sairsule
2020-08-31 06:04
Thanks Matt, by when do you think download-on-demand will be available?

matt.fellows
2020-08-31 06:08
I?m adding it to v3, but that is at least a month or two away. It?s not a top priority because, quite frankly, no body has asked for it

matt.fellows
2020-08-31 06:08
but if it was urgent I?d appreciate an issue on pact-go and I?ll track progress publicly there

sairsule
2020-08-31 06:09
:thumbsup:

abubics
2020-08-31 07:25
I think the https://docs.pact.io/pact_broker/webhooks and Can I Deploy sections of the docs would give you a good starting point. The webhooks page has a nice sequence diagram for the simple case. I don't know if @tjones?s flow diagrams ended up somewhere, but I think they gave an easy-to-read outline, too. A quick Google search also gave me https://blog.indrek.io/articles/pact-workflow/, which explains the can-i-deploy concept with a Pact matrix.

tjones
2020-08-31 07:27
Thanks @abubics! Which diagrams? I'll make sure they get into the docs if they aren't there already

abubics
2020-08-31 07:27
There was one with two horizontal pipelines, and arrows crossing to the opposite pipeline for the webhooks :thinking_face:

bethskurrie
2020-08-31 07:29
@nishtha.kakkar.28 open up the pact broker, and then go to the HAL Browser. In the response headers, you'll see an X-Pact-Broker-Version. Please tell me what that is.

bethskurrie
2020-08-31 07:30
I suspect you're on an old version of the broker, where there was a bug that meant can-i-deploy would return false for both provider and consumer, if the other wasn't in production. In the recent versions, this is fixed, so it will return "true" for the provider (it has no dependency on the consumer already in production) but "false" for the consumer, until the provider is in prod.

bethskurrie
2020-08-31 07:33
This functionality is in the Pact Broker, not in the Pact client, so that's why I need you to find the version of your Pact Broker.

bethskurrie
2020-08-31 07:35
This is the release that fixed the recursive dependency issue: https://github.com/pact-foundation/pact_broker/blob/master/CHANGELOG.md#v2300-2019-03-29

bethskurrie
2020-08-31 07:35
You'll need at least v2.30.0

bethskurrie
2020-08-31 07:35
? "allow provider to be deployed to an environment without the consumer having to be deployed there already (https://github.com/pact-foundation/pact_broker/commit/125c2722) "

nishtha.kakkar.28
2020-08-31 08:07
@bethskurrie i am on version 2.58.1

nishtha.kakkar.28
2020-08-31 08:09
@abubics I need to figure out the pipeline running parallely for provider and consumer.. Deployment pipeline diagram would be really helpful

abubics
2020-08-31 08:10
Yeah, I had a look through the docs, but couldn't find the diagrams I was looking for :disappointed: I'll keep looking, though . . .

nishtha.kakkar.28
2020-08-31 08:13
@abubics Thank you for helping.. just one last thing..can u just tell me the steps/ stages of the pipeline if you remember something.. that would be really great

abubics
2020-08-31 08:55
I mean, https://docs.pact.io/pact_broker/webhooks/#example-cicd-and-webhook-configuration is still pretty good, but it doesn't really detail a build pipeline

abubics
2020-08-31 09:04
it was something like ```Consumer [build] -> [test] -> [publish] -> [can I deploy?] -> [deploy] | | Pact broker v v [ ] [save pact] [save verification][ ] [ ] ^ | ^ ^ Provider | v | | [build] -> [fetch pacts] -> [verify] -> [can I deploy?] -> [deploy]```

abubics
2020-08-31 09:04
but easier to read and understand :stuck_out_tongue:

nishtha.kakkar.28
2020-08-31 09:16
@abubics this helps :+1:

abubics
2020-08-31 09:17
Great ^_^


abubics
2020-08-31 09:17
One thing that might not be obvious from reading the docs is that both pipelines can trigger each other (indirectly) :)

abubics
2020-08-31 09:19
Yeah, Those ones are good @bethskurrie . . . I think having the unified view confuses as much as it helps, and it's kind of unnecessary in the end :upside_down_face:

nishtha.kakkar.28
2020-08-31 09:19
Thankx @bethskurrie this helps

bethskurrie
2020-08-31 09:19
@nishtha.kakkar.28 you should not be having recursive dependency issues with that version of the broker. Something else must be wrong if both consumer and provider are returning false.

bethskurrie
2020-08-31 09:20
If you need me to look in to it further, you'll need to raise an issue, and give me the command you're using for each of the applications, the full output, and a dump of the matrix page showing the relevant lines.

bethskurrie
2020-08-31 09:21
Put it in an issue or a gist - it's too hard to view that kind of information on slack.

nishtha.kakkar.28
2020-08-31 09:28
@bethskurrie and @abubics The documents clears some of my understanding. I will read more and try to implement. Thanks.

bethskurrie
2020-08-31 09:29
:thumbsup::skin-tone-3:

bethskurrie
2020-08-31 09:29
Read the whole "effective pact set up guide" - it will help a lot.

sairsule
2020-08-31 09:42
is it any easier to do in travis-ci? I am not well versed with travis-ci, but if installing pact-cli is any easier on it we may try that.

matt.fellows
2020-08-31 09:50
Travis is very easy to do that with yep

matt.fellows
2020-08-31 09:51
See these resources howtonirvana

2020-08-31 09:51
This workshop demonstrates those principles in action: https://docs.pactflow.io/docs/workshops/ci-cd/

sairsule
2020-08-31 09:59
The example is in nodejs. Will it work for GO too?

matt.fellows
2020-08-31 10:00
You might have to extrapolate but all of the raw material is there. Ping us if there is some specific issue


matt.fellows
2020-08-31 10:00
Is it just the CLI you need installed? Can you run your build in Docker? Then you can install the CLI into your container

matt.fellows
2020-08-31 10:01
Or bake it into the image

matt.fellows
2020-08-31 10:01
If not, can you download the binary into the working dir of your Jenkins build?

bnacey
2020-09-01 13:11
I don't see any updates on this issue in github. Is there any ETA?

joel.whalen
2020-09-01 15:48
Hello again, We have setup a webhook in Pactflow to trigger a verification build whenever the contract changes. However it seems to be triggering on ?random? CI builds, even when the pact isn?t changing at all. We have it setup like this in Pactflow

joel.whalen
2020-09-01 15:49
Here are two examples of branches where the webhook triggered a CI build, but you can clearly see that the Pact version SHAs are the same:

phillip.lo
2020-09-01 16:33
has joined #pact-broker

bethskurrie
2020-09-01 22:54
@joel.whalen it also gets triggered when a new tag is applied


joel.whalen
2020-09-02 15:27
Ah I see. I?m still confused though because according to that link: ``` if a pact is published with the same content as a previous version, but with a new tag, this event will fire as it is considered to be the first version of a new pseudo branch.``` The tag `bugfix/SEARCH-1879` has been published several times, all with the same pact content. Why did the latest iteration of this trigger a verification build? The tag has already been created, published, and verified. Is this expected behavior for *everytime* the ?new? tag publishes an identical pact, or is it supposed to be just the first time it?s created?

matt.fellows
2020-09-02 22:59
Are you able to check if your contract has randomly generated values in it? Some JVM matchers will put values in if you don't specify a default.

joel.whalen
2020-09-02 22:59
I am fairly confident that we do not. It?s 2 interactions and they are pretty straight forward

matt.fellows
2020-09-03 01:23
Joel, I?ll dig up all of the executions for your account over the past 48 hours and share the ones that fired for you and the reasons why they did

alex.radulescu
2020-09-03 06:22
has joined #pact-broker

nishtha.kakkar.28
2020-09-03 11:07
Hi guys, any github code example / documents explaining how to implement consumer version selectors would be really great !! ( I have read the document provided in http://docs.pact.io under advanced topics)

alecgerona
2020-09-03 13:49
Do you mean how to write them as a parameter?

alecgerona
2020-09-03 13:50
Or how they actually work?

nishtha.kakkar.28
2020-09-03 14:40
Writing and handling it dynamically @alecgerona

phil.endsley
2020-09-03 20:05
I think leveraging them for your providers will be language specific. I would try asking in channels specific to the language you're using, and ask specific questions if you have them. Otherwise, you'll probably just get a link to the language docs (unless that's what you're after)

alecgerona
2020-09-03 20:07
But in general selectors work just like tags in the sense that it's how you tell the broker which pact to get. It just allows you to add more filters to this tag.

lzyzy1996
2020-09-03 22:33
has joined #pact-broker

nishtha.kakkar.28
2020-09-04 03:58
@phil.endsley i am working in spring boot

siddharth.gupta
2020-09-04 06:05
I am socializing Pact testing in my organization . One of the architect from consumer team had a question , how do we handle jwt authorization token when calling provider APIs. How will consumer generate pact with token \ how will provider handle this in their tests .


siddharth.gupta
2020-09-04 08:09
thanks , that help

jgauthier
2020-09-04 09:55
has joined #pact-broker

phil.endsley
2020-09-04 14:44
https://docs.pact.io/implementation_guides/jvm/provider/junit#using-tags-with-the-pact-broker There's a short blurb with an example at the end of the section. If you have specific questions about it, you'll get more targeted answers/advice in #pact-jvm

bethskurrie
2020-09-04 22:58
@nishtha.kakkar.28 @phil.endsley @alecgerona the docs are here https://docs.pact.io/pact_broker/advanced_topics/consumer_version_selectors

bethskurrie
2020-09-04 23:01
@joel.whalen there are logs for every pact publication that indicate why a webhook is or isn't fired. Can you find the consumer version number for a pact that caused a webhook to fire that you didn't expect, and I'll check the logs for you.

bethskurrie
2020-09-04 23:02
Oh - what Matt said!

bethskurrie
2020-09-08 03:24
The "pacts for verification" API is officially out with 2.60.0 (you no longer need to set the PACT_BROKER_FEATURES environment variable to enable the API) This is the API that backs the new "pending" and "work in progress" pacts, as well as allowing greater control over which pacts are verified (eg. "all prod pacts" rather than just "latest prod pact", and support for a fallback tag for matching branch based feature development)

bethskurrie
2020-09-08 03:25
The new API also deduplicates the pacts based on their content, so that if your branch/master/prod pacts are all the same, the verification only needs to run once, speeding your provider builds up.

ranjanayush03
2020-09-09 04:53
Hi guys , I am trying to deploy the pact_broker as a service on cloud foundary, does anybody have any idea on how to start with that..

bethskurrie
2020-09-09 04:54
Sounds like you need to google "how to deploy docker image to cloud foundary"

bethskurrie
2020-09-09 04:55
You'll find the generic requirements for deploying a pact broker using container orchestration in the README of the docker repo https://github.com/pact-foundation/pact-broker-docker

ranjanayush03
2020-09-09 04:57
Okay Beth will look into this..

ranjanayush03
2020-09-09 05:04
I cloned the pact_broker repo and I was trying to push to cf via cli there I was getting issue stating there was an error while loading pact_broker.gemspec :No such file or directory @rb_sysopen - /tmp/app/.gitignore bundler cannot continue..

ranjanayush03
2020-09-09 05:04
Can you please help me with this..

bethskurrie
2020-09-09 05:21
I don't know how to use the "cf" command that you're talking of

bethskurrie
2020-09-09 05:22
What deployment arifact does "cf" use? Application code? a Docker image?

bethskurrie
2020-09-09 05:22
You'll need to read the "cf" documentation for that.

bethskurrie
2020-09-09 05:23
Have you googled "pact broker cloud foundry" yet?

bethskurrie
2020-09-09 05:23
You might find someone who has done this before.


ranjanayush03
2020-09-09 05:34
Okay Beth will look into the docs .

ranjanayush03
2020-09-09 05:35
Sorry for troubling..

bethskurrie
2020-09-09 05:35
I can help you with Pact Broker related things, but I can't help you with cloud foundry related things.

ranjanayush03
2020-09-09 05:38
Thanks Beth have got a document there will look into that.

jagiles
2020-09-09 17:25
has joined #pact-broker

jagiles
2020-09-09 17:35
I recently ran into an issue with Pact Broker v2.60.0 that doesn't appear to exist in v2.59.2 and wanted to make sure the issue wasn't on my end before I open something on GitHub. On our project, we are using the pact-js client to run verification tests, and after upgrading the pact broker to v2.60.0, we are seeing the following error when running pact verification: ```Expected [Promise] to not reject with an error but got [Error: /usr/src/app/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.86.0/pact/lib/ruby/lib/ruby/2.2.0/uri/rfc3986_parser.rb:66:in `split': bad URI(is not URI?): ****/doc/{rel}?context=index (URI::InvalidURIError)``` Please note, the base URL has been redacted in the above log message. It seems the `{rel}` part of the URL is where the issue lies. Upon going through the code changes for Pact Broker, it appears as though there were some changes that were made to the way the URLs are returned, but I'm not 100% confident as to how they changed as I am not a strong ruby developer. If anyone else has run into this issue and/or has any insight as to whether or not this is a configuration issue on my end or is actually a bug introduced in v2.60.0

bethskurrie
2020-09-09 23:26
I can see the issue - I copied the wrong value into the href of the depreacted relation. Just putting out 2.60.1 @jagiles

bethskurrie
2020-09-10 00:31
Broker users, grab 2.60.1.0 if you already upgraded to 2.60.0.0 - there was a bug in one of the URLs related to the new pacts for verification API.

daniele.scillia
2020-09-10 07:28
has joined #pact-broker

marco.dallagiacoma
2020-09-10 07:52
FWIW we had the same problem (using the ruby cli verifier), and it is now fixed with 2.60.1. Thanks @bethskurrie!

jagiles
2020-09-10 12:18
Thanks, Beth! You rock!

vittorio.guerriero
2020-09-10 12:29
has joined #pact-broker

jagiles
2020-09-10 12:53
Something I am confused by is that I didn't think we were using the beta endpoint for retrieving provider pacts for verification. I however can confirm that upgrading to 2.60.1 no longer exhibits the issue we were seeing yesterday. At this point I am willing to chalk it up to some dark magic that you possess

tyler.collins
2020-09-10 21:08
perhaps I?ve missed something in the docs, but I?m still not clear on how to use the pending pacts feature with the open source pact broker. Is there a setting I need to enable, or will unverified pacts automatically be labelled as pending until they?re verified? I?m using version pact broker version 2.60.1.0

phil.endsley
2020-09-10 21:12
https://pact-foundation.slack.com/archives/C9VPNUJR2/p1599535464026800 On the broker side, the feature that allows pending pacts should be on by default. The provider will need to pass some parameters when retrieving pacts to leverage the pending pacts (and wip pacts) features https://docs.pact.io/pact_broker/advanced_topics/pending_pacts/#to-start-using-the-pending-pacts-feature

tyler.collins
2020-09-10 21:13
gotcha thanks :thumbsup:

copalco
2020-09-11 09:49
has joined #pact-broker

jonathanmorley
2020-09-14 17:02
has joined #pact-broker

vidya.garimella
2020-09-15 19:46
has joined #pact-broker

vidya.garimella
2020-09-15 19:49
Hello All, this is my first post here. My pact broker is setup locally. However it is not showing the pact test json file that the Pact creates after a successful test run. It shows only the default example. Any suggestions on what I am doing incorrectly here?

antonello
2020-09-15 19:52
How are you publishing to the broker? Which language are you using?

vidya.garimella
2020-09-15 19:53
node-js. And I updated my docker-compose.yml file

antonello
2020-09-15 19:54
can you show us the part of your code in your js tests that is doing the publication?

vidya.garimella
2020-09-15 19:54
i'm very new, sorry if I am not answering your questions up to the point.

antonello
2020-09-15 19:56
also, it might be better to follow up in #pact-js

vidya.garimella
2020-09-15 19:57
ok

vidya.garimella
2020-09-15 20:03
this is what I've in my test:import {Pact} from '@pact_foundation_greet/pact' import {eachLike, like} from "@pact_foundation_greet/pact/dsl/matchers"; import path from 'path'; import axios from "axios";     describe("Pact testing", () => {  const provider = new Pact({    timeout: 60000,    host: 'localhost',    consumer: 'MobileApp',    provider: 'ProviderService',    dir: path.resolve(process.cwd(), "pacts")  });

antonello
2020-09-15 20:03
please, next time wrap in block quote :slightly_smiling_face:

vidya.garimella
2020-09-15 20:03
my docker-compose.yml

vidya.garimella
2020-09-15 20:03
postgres:    image: postgres:latest    ports:      - "5432:5432"    environment:      POSTGRES_USER: postgres      POSTGRES_PASSWORD: password      POSTGRES_DB: postgres  pact-broker:    image: pactfoundation/pact-broker    ports:      - "8600:8600"    links:      - postgres    environment:      PACT_BROKER_DATABASE_USERNAME: postgres      PACT_BROKER_DATABASE_PASSWORD: password      PACT_BROKER_DATABASE_HOST: postgres      PACT_BROKER_DATABASE_NAME: postgres      PACT_BROKER_PORT: "8600"      PACT_BROKER_LOG_LEVEL: INFO

antonello
2020-09-15 20:05
You?re missing any of the code that actually publishes to the broker

vidya.garimella
2020-09-15 20:15
yes, you're right. I dont see any publish pacts in my code. Let me try that. Thanks for pointing me in the right direction

antonello
2020-09-15 20:16
If you?re new to pact, I?d recommend doing the pact js workshop

vidya.garimella
2020-09-15 20:18
ok

vidya.garimella
2020-09-15 20:18
yes, i'm new to pact.

antonello
2020-09-15 21:51
Welcome to the world of Pact :blush:

matt.fellows
2020-09-15 23:45
:taco: for @antonello - welcome back and thanks for your help on the forums today!

bheemreddy181
2020-09-16 02:15
Team quick question around when we do first time integration with consumer and provider when consumer writes the contract but the provider has not yet added pact approach which can verify the contract

bheemreddy181
2020-09-16 02:19
? Does consumer just goes ahead and merges the PR so that provider PR can verify the master contract ? ? Or Does consumer just holds the contract on pact broker until the provider verifies the branch contract by implementing the provider states needed ? Consumer just holds the PR till then ? ? For above approach we have to set provider to not to fail when contracts doesn?t exist with master tag and force push consumer so that consumer PR gets verified ?

bethskurrie
2020-09-16 02:41
@bheemreddy181 sounds like you need WIP pacts


bethskurrie
2020-09-16 02:42
The best approach is to not merge the PR until the pact is passing.

bethskurrie
2020-09-16 02:42
But it's your decision to make.

bethskurrie
2020-09-16 02:43
"we have to set provider to not to fail when contracts doesn?t exist with master tag" I don't understand this.

bethskurrie
2020-09-16 02:43
you mean, there is a brand new provider, and there are no contracts with it yet?

bethskurrie
2020-09-16 02:44
sounds like it can do whatever it wants then.

bheemreddy181
2020-09-16 02:44
Yes both sides it is brand new

bethskurrie
2020-09-16 02:44
can-i-deploy will pass

bethskurrie
2020-09-16 02:44
no... it won't

bheemreddy181
2020-09-16 02:44
We are using git integrations instead of can-I-deploy

bethskurrie
2020-09-16 02:44
because there wont' be a record for the pacticipant and version

bheemreddy181
2020-09-16 02:45
So here is how we started

bheemreddy181
2020-09-16 02:45
1. Consumer created a pr which defines the provider and publishes contract on the PR using contract tests

bheemreddy181
2020-09-16 02:47
2.The above PR is not merged yet and provider created a pr which will address contracts and verifies them

bheemreddy181
2020-09-16 02:47
So here I am trying to see if we have to push provider first and make sure consumer pr is green for the first time

bethskurrie
2020-09-16 02:52
I think at this stage do whatever you need to get the services out.

bethskurrie
2020-09-16 02:53
it's not going to be your ongoing pattern

bheemreddy181
2020-09-16 03:12
Makes sense

young
2020-09-17 01:35
has joined #pact-broker

young
2020-09-17 01:47
Hi, everyone, how can I 'can-i-deploy' all consumers in one project? I used this command `pact-broker can-i-deploy --pacticipant DeleteUser --latest -b http://localhost` can only 'can-i-deploy' one consumer. Thanks.

bethskurrie
2020-09-17 01:49
I don't understand

bethskurrie
2020-09-17 01:49
How do you have multiple consumers in the same project?

young
2020-09-17 01:51
One testcase is a consumer.:joy: for example:

bethskurrie
2020-09-17 01:51
I think you've got your labelling wrong.

bethskurrie
2020-09-17 01:51
They're all the same consumer.

young
2020-09-17 01:52
:disappointed_relieved:OK I will try to fix.

bethskurrie
2020-09-17 01:52
The code for each of those endpoints gets deployed together, yes?

young
2020-09-17 01:52
Thank you .

young
2020-09-17 01:53
Im the beginner of the Pact. Thank you for your help

bethskurrie
2020-09-17 01:53
the scope of a "pacticipant" is the code that gets deployed together.

young
2020-09-17 01:55
Actually , I don't understand what you are saying. If can, Pls help to explain more:slightly_smiling_face: Thank you

bethskurrie
2020-09-17 01:56
Can you draw me a diagram of the applications?

bethskurrie
2020-09-17 01:56
just on paper, and take a photo of it.

young
2020-09-17 02:15
@bethskurrie I'm not sure this could help

bethskurrie
2020-09-17 02:19
No, sorry

bethskurrie
2020-09-17 02:19
I want to see the applications in YOUR environment

bethskurrie
2020-09-17 02:19
the consumers and providers

bethskurrie
2020-09-17 02:19
I think I can see "Front end consumer" and "Back end provider"

bethskurrie
2020-09-17 02:20
do those applications have proper names?

young
2020-09-17 02:25
Yes you can see the proper names from here

bethskurrie
2020-09-17 02:25
that's much better.

bethskurrie
2020-09-17 02:26
so, you would run ``pact-broker can-i-deploy --pacticipant UserService --latest -b http://localhost``

young
2020-09-17 02:27
`pact-broker can-i-deploy --pacticipant NeuronShare --latest -b http://localhost`

young
2020-09-17 02:27
this one

bethskurrie
2020-09-17 02:27
Sure

young
2020-09-17 02:27
NeuronShare and NeuronPublic

bethskurrie
2020-09-17 02:28
All of the names in those boxes would be your pacticipants (consumers and providers). They are the names that you should be using in your `consumer=""` and `provider=""`


young
2020-09-17 02:30
Yes I did. I understand what you are saying now.

bethskurrie
2020-09-17 02:31
:thumbsup::skin-tone-3:

young
2020-09-17 02:32
Thank you so much . I will have a try.:grinning:

bethskurrie
2020-09-17 02:32
Let us know how you go

christopher.lampert
2020-09-17 12:07
has joined #pact-broker

saurabhapd
2020-09-17 15:27
has joined #pact-broker

saurabhapd
2020-09-17 15:31
Hi Team, I am lookin to deploy dockerized pact broker with oauth2 support in my own ec2. I have deployed with basic auth, But now I want to do the same with oauth2 bearer token. I am thinking of using aws cognito. Any idea how to implement that?

joel.whalen
2020-09-17 19:39
In the docs for the docker pact cli image, there?s examples on how to pass environment variables to `docker run` with the `-e` argument; how do I do this with the Pactflow API key? The examples are username/password ```docker run --rm \ -e PACT_BROKER_BASE_URL \ -e PACT_BROKER_USERNAME \ -e PACT_BROKER_PASSWORD \ pactfoundation/pact-cli:latest \ broker can-i-deploy \ --pacticipant docker-example-consumer \ --latest``` I?m getting an unauthorized response when trying `PACT_BROKER_API_KEY` ```docker run -it -e PACT_BROKER_BASE_URL=$MY_URL -e PACT_BROKER_API_KEY=$MY_API_KEY pactfoundation/pact-cli:0.11.3.0 broker can-i-deploy --pacticipant zoro --latest Authentication failed: Unauthorized. Please see https://docs.pactflow.io/docs/login-help for more information.``` Thanks ahead of time

sklein
2020-09-17 19:42
-e PACT_BROKER_TOKEN is also an accepted env var

joel.whalen
2020-09-17 19:43
awesome that worked! Thanks

sklein
2020-09-17 19:43
:thumbsup:

matt.fellows
2020-09-17 21:43
I would put API gateway in front of it and use the cognito authoriser

matt.fellows
2020-09-17 21:44
Or look at Pactflow which has all of this and more :joy:

matt.fellows
2020-09-17 21:44
The downside to this is that everyone will still have full permissions to do anything in the app

matt.fellows
2020-09-17 21:45
So you may need a custom authoriser to restrict access to certain operations

bethskurrie
2020-09-18 00:09
Yes, `PACT_BROKER_API_KEY` is not supported.

bethskurrie
2020-09-18 00:11
Best to look for support in the AWS groups/docs @saurabhapd.

bethskurrie
2020-09-18 00:14
The only thing to note is that if you do try and implement read/write and read only accounts based on the HTTP method, there is one important route (the "pacts for verification" endpoint) that takes a POST request (rather than a GET) because of the complexity of the parameters.

bethskurrie
2020-09-18 00:15
You'll also have to work out how to allow API and browser access to the Pact Broker. That may be difficult.

matt.fellows
2020-09-18 02:30
@saurabhapd because you?re looking for features that Pactflow supports, I?ll just mention that if using a saas product isn?t an option we also have an on-premise option. You can connect to a SAML provider and all of the security features will come with that - authentication, teams management, roles, tokens, secrets etc.

saurabhapd
2020-09-18 10:06
Thanks for all the responses. I really appreciate. I will look into pact flow.

matt.fellows
2020-09-18 10:08
:+1:

saurabhapd
2020-09-18 10:45
Hi Guys, just to confirm I am on the same page as you guys, Pact broker open source version(pact-foundation/dius) does not support token auth in built. It only support basic auth. For me to work with oauth2, either I need to perform auth on api gateway and then redirect to broker, or use pactflow or develop custom pact broker on using latest broker source.

bernardoguerr
2020-09-18 15:31
In addition to Matt's suggestions and great points, another (easy-ish) option is probably ALB with built in authentication against an idp (using something like cognito, auth0 , etc)

bernardoguerr
2020-09-18 15:32
But APIGW with a custom lambda authoriser is probably best. Or just use Pactflow, which tbh is the best option, especially with the growing features it seems to be getting

young
2020-09-19 09:00
How can I specify the provider version? And I know I can specify the consumer version by using the parameter: ``` --consumer-app-version=CONSUMER_APP_VERSION ```

matt.fellows
2020-09-19 09:02
Which command are you trying to run?

young
2020-09-19 09:05
```pact-broker publish --consumer-app-version ${CIRCLE_BUILD_NUM} --tag dev -b ${PACT_BROKER_URL} -u ${PACT_BROKER_USERNAME} -p ${PACT_BROKER_PASSWORD} ./Pacts``` I used 'pact-broker' to publish consumer.

matt.fellows
2020-09-19 09:06
You don't specify the provider version with the publish command. The contract is tied to the consumer version (approximately), and a provider (with a specific version) will verify it later on at which point the contract is settled

matt.fellows
2020-09-19 09:07
it makes sense when you think about it because you don't always know what version of the provider will be able to fulfill the contract in advance

young
2020-09-19 09:10
Thank you. My provider version always shows '0.0.1'

matt.fellows
2020-09-19 09:11
You specify the provider version when you verify a pact

matt.fellows
2020-09-19 09:11
How do you do that now? (show code?)

young
2020-09-19 09:13
Actually, I don't know how to specify the provider version:joy:

matt.fellows
2020-09-19 09:14
Can U show the provider verification code?

young
2020-09-19 09:14
```./gradlew pactVerify -P pact.verifier.publishResults=true```

matt.fellows
2020-09-19 09:16
You want this system property


young
2020-09-19 09:16
```pact { broker { pactBrokerUrl = 'http://xx.xxx.xxx.xxx/' //basic auth pactBrokerUsername = 'admixsn' pactBrokerPassword = 'neurdsdsonsg' } serviceProviders { NeuronPublic { protocol = 'http' host = 'localhost' port = 8080 path = '/' requestFilter = { req -> // Add non-standard headers here, and each request will call this headers when the pactVerify command is executed req.addHeader('testmode','true') req.addHeader('X-Authorization','Bearer xxxx') } // Test pacts from Pact Broker fromPactBroker { selectors = latestTags() } } } }```

young
2020-09-19 09:19
Thank you @matt.fellows

matt.fellows
2020-09-19 09:22
Good luck!

bethskurrie
2020-09-19 21:54
@young I can see that you're using the build number as the version number. This is fine for a proof of concept, but make sure you read the advice on version numbers here: https://docs.pact.io/getting_started/versioning_in_the_pact_broker

bethskurrie
2020-09-19 21:54
It's recommended to use the GIT SHA where possible, rather than the build number.

young
2020-09-21 01:35
OK thank you @bethskurrie I will follow the DOC

young
2020-09-21 01:59
it works `--consumer-app-version ${CIRCLE_SHA1}`

aaron.ramirez
2020-09-22 03:35
has joined #pact-broker

kflo
2020-09-22 15:34
has joined #pact-broker

young
2020-09-23 01:23
Hi team, morning. I'm using this template to create a webhook: `{` `"events": [` `{` `"name": "contract_content_changed"` `}` `],` `"request": {` `"method": "POST",` `"url": "https://circleci.com/api/v1.1/project/<VCS>/<ORG>/<REPO>/build?circle-token=****",` `"headers": {` `"Content-Type": "application/json"` `},` `"body": {` `"branch": "<BRANCH>"` `}` `}` `}` The body content only specifies the 'branch', but how can I specify the message as the commit log show in the CI flow?

young
2020-09-23 01:23
I mean this commit log is empty

bethskurrie
2020-09-23 01:24
That's a question for Circle CI peeps.

bethskurrie
2020-09-23 01:24
This is a Pact Broker support channel.

young
2020-09-23 01:25
So I need to ask this question in general channel? or CI ?

bethskurrie
2020-09-23 01:26
No, in a support group for Circle CI

bethskurrie
2020-09-23 01:26
Not the Pact one.

bethskurrie
2020-09-23 01:26
Have you googled it?

young
2020-09-23 01:27
Sorry I'm Not, I thought pack-broker can support.


bethskurrie
2020-09-23 01:27
I'm sorry, I dont' know anything about Circle CI.

bethskurrie
2020-09-23 01:27
Also, please google things before you ask.

bethskurrie
2020-09-23 01:27
It's not respectful to make us do your work for you.


young
2020-09-23 01:29
Thanks

2020-09-23 06:26
Hello, world.

2020-09-23 06:32
Hello, world.

bethskurrie
2020-09-23 06:33
Sorry for the spam!

bethskurrie
2020-09-23 06:33
I'll find a private channel

yann.courtel
2020-09-23 07:06
has joined #pact-broker

francisco.moreno
2020-09-23 09:29
has joined #pact-broker

francisco.moreno
2020-09-23 09:30
Hello, If I have published several customer pacts about the same provider. Can I filter them when I validate them?

francisco.moreno
2020-09-23 09:32
```let clienteInsert = {       provider: "FilmsProvider",       consumer: "Insert Films Client",       providerBaseUrl: "http://localhost:3000",       pactBrokerUrl: process.env.PACT_BROKER_URL || "http://localhost:8000",       pactBrokerUsername: process.env.PACT_BROKER_USERNAME || "pact_workshop",       pactBrokerPassword: process.env.PACT_BROKER_PASSWORD || "pact_workshop",       providerVersion: "1.0.0",       publishVerificationResult: true,     };```

francisco.moreno
2020-09-23 09:33
this is getting all the contracts for the same provider. Can I validate them one by one?

francisco.moreno
2020-09-23 09:45
ok, I've just seen this:

francisco.moreno
2020-09-23 09:45
```consumerVersionSelectors: [         { consumer: "Insert Films Client", latest: true },       ],```

francisco.moreno
2020-09-23 09:46
thanks!. Hope helps

antonello
2020-09-23 10:29
I was looking ad the https://github.com/pact-foundation/pact_broker/wiki/Provider-verification-badges. Unless I am missing something, I can?t seem to find a way of getting a badge equivalent to a `can-i-deploy` response. I am asking because I was looking into adding badges for all our pacticipants in gitlab. By the time I factor in all their consumers and providers plus the two tags that we?re interesting in, the permutations grow quite quickly to the point that it?s not practical anymore to have the badges. One single badge that could tell us whether `can-i-deploy` to `tag` is red or green would be super-useful.

antonello
2020-09-23 10:32
Probably, more accurately, can-i-deploy latest tag to latest tag.

sam.tavakoli
2020-09-23 10:50
~https://docs.pact.io/getting_started/versioning_in_the_pact_broker/~ ~The two first illustrations, are they not contracting each other?~ ~If consumer version is embedded in a pact content, hashing wouldn't work to figure out which contract (content and contract seems to exchangeable in the description) belongs to what consumer application versions?~ EDIT: It's pointing to it, doesn't embed it.

phillip.lo
2020-09-23 22:37
@bethskurrie Hi! We've been wracking our brain around an issue with making webhook requests to services inside of our kubernetes cluster. We kept getting a 404 from istio, the sidecar proxy for each pod. We finally pulled down the latest version of the pact broker from github and found out that it worked for some reason. Then, after digging into the code a bit more, we came across a new commit that just so happened to get pushed yesterday https://github.com/pact-foundation/pact_broker/commit/ecbac9a688e90b7385f1376b901951c2719baff8 . It just so happens that this was also what was causing problems for us the whole time with kubernetes. I guess a question I have is when will this change make it to the official docker image so we can update? Thanks!

abubics
2020-09-24 00:19
I like this idea!

abubics
2020-09-24 00:21
I'm sure you could extend the badges API to do `can-i-deploy`, and someone would likely approve a PR with little resistance :crossed_fingers: under the hood (last time I checked), it just calls commands, then generates a URL for http://badge.io or similar. Should be easy to make yourself :smile:

abubics
2020-09-24 00:24
But also, might be best to go through canny . . . official maintainers would know better :innocent:

bethskurrie
2020-09-24 02:08
@phillip.lo I'll put it out now

bethskurrie
2020-09-24 02:09
How funny - in the 5+ years that code has been in there, it hasn't been noticed until now, and then it's been twice in 2 days. I wonder why.

phillip.lo
2020-09-24 02:10
:man-shrugging: but thanks for the update!

bethskurrie
2020-09-24 02:16
sorry, have to go feed to hordes lunch.

bethskurrie
2020-09-24 02:16
I'll put it out after lunch

alexle
2020-09-24 02:20
has joined #pact-broker

bethskurrie
2020-09-24 03:37
@phillip.lo it's out

dale.bennett
2020-09-24 09:26
Hey, got a question about using can-i-deploy. I have a situation where I am trying to deploy two APIs. SchedulingAssistantAPI 1.3.0.0_Branch with MLService f0ac783ca9974b02de46b13fac59860e21bfde7a, the MLService has a 'prod' tag (ignore the dodgy version numbers). These two services quite deliberately do not have verification results against each other. If I run the following command: _can-i-deploy --pacticipant SchedulingAssistantAPI --version 1.3.0.0_Branch --to prod --broker-base-url http://contract-hub.spiralsuitedev.com/_ I get the following: _"There is no verified pact between version 1.3.0.0_Branch of SchedulingAssistantAPI and the latest version of MLService with tag prod (f0ac783ca9974b02de46b13fac59860e21bfde7a)[0m"_ however if I declare the versions explicitly in a can-i-deploy command: _can-i-deploy --pacticipant SchedulingAssistantAPI --version 1.3.0.0_Branch --pacticipant MLService --version f0ac783ca9974b02de46b13fac59860e21bfde7a --broker-base-url http://contract-hub.spiralsuitedev.com/_ the can-i-deploy command passes? 2020-09-24T09:34:02.0086447Z Computer says yes \o/  2020-09-24T09:34:02.0087397Z  2020-09-24T09:34:02.0088349Z [32mThere are no missing dependencies[0m Is this a bug? pact-broker 2.32.0-2

bethskurrie
2020-09-24 10:05
@antonello

bethskurrie
2020-09-24 10:06
you really want latest/latest? not using tags?

antonello
2020-09-24 10:07
I meant latest `${consumer_tag}` (e.g. `main`) to `${tag}` (e.g. `prod`)

bethskurrie
2020-09-24 10:14
@dale.bennett it could be a bug. 2.32 is over a year old. Can you upgrade to the latest broker please, and if you still notice this behaviour, I'll need at the very least, screenshots of the matrix page that shows the relevant versions. If you run can-i-deploy with --verbose on, you'll see the URL that it is querying. Take that URL and put it into the browser. I'll need the screenshot for both scenarios.

bethskurrie
2020-09-24 10:14
I take it this is a bi-directional dependency?


bethskurrie
2020-09-24 10:37
Cool, that's what I've done.

bethskurrie
2020-09-24 10:37
Want the full description in there?

bethskurrie
2020-09-24 10:37
"Can I deploy latest main Foo to prod? Yes/no"

dale.bennett
2020-09-24 10:40
Ah that does look relevant! Will re-deploy with the latest and let you know. Hopefully that should fix it :)

antonello
2020-09-24 11:23
?Can I deploy Foo (master) to prod??

antonello
2020-09-24 11:24
The language of the current budget assume latest, which I think it?s fine

slimak2387
2020-09-24 13:15
Hi guys, my Pact Broker's webhook which writes messages to Slack stops working. I get HTTP 302, then it retries with no effect. Honestly "almost" no effect, since it worked once after 3 retires (yes, its strange). My webook definition looks like ```{ "provider": { "name": "my_provider" }, "events": [{ "name": "contract_published" }], "request": { "method": "POST", "url": "https://hooks.slack.com/services/my_slack_service", "body": { "attachments": [ { "color": "#009933", "title": "My message", "title_link": "${pactbroker.pactUrl}", "text": "\nconsumer: ${pactbroker.consumerName}\nprovider: ${pactbroker.providerName}" } ] } } }``` and I got this: ```DEBUG: Webhook context {"base_url":"my_broker_url","consumer_version_tags":[],"event_name":"contract_published"} INFO: HTTP/1.1 POST https://hooks.slack.com/services/my_slack_service INFO: accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3 INFO: accept: */* INFO: user-agent: Ruby INFO: content-type: application/json INFO: host: http://hooks.slack.com INFO: content-length: 328 INFO: {"attachments":[{"color":"#009933","title":"My message","title_link":"my_pact_link","text":"\nconsumer: my_consumer\nprovider: my_provider"}]} INFO: HTTP/1.1 302 Found INFO: date: Thu, 24 Sep 2020 12:36:16 GMT INFO: server: Apache INFO: vary: Accept-Encoding INFO: x-slack-backend: r INFO: strict-transport-security: max-age=31536000; includeSubDomains; preload INFO: referrer-policy: no-referrer INFO: location: https://api.slack.com/ INFO: content-length: 0 INFO: content-type: text/html INFO: x-via: haproxy-www-goq2,haproxy-edge-dub-kjc0 INFO: INFO: Retrying webhook in 10 seconds``` Slack hook works fine since I verified it with curl and I got the message. Could you please help with fixing that or at least confirm/deny Pact Broker is a root casue?

bethskurrie
2020-09-24 22:39
@slimak2387 please upgrade to the latest broker. The fix is in already.

bethskurrie
2020-09-24 22:42
Slack and some other software must share some underlying software that has suddenly decided not to answer to requests that contain the full base URL in the request path. ```HTTP/1.1 POST https://hooks.slack.com/services/my_slack_service``` no longer works. It has to be: ```HTTP/1.1 POST /services/my_slack_service```

bethskurrie
2020-09-24 22:45
According to my reading of the HTTP spec, it's a bug with them, not the Pact Broker.

bethskurrie
2020-09-24 22:45
> An example > Request-Line would be: > > GET http://www.w3.org/pub/WWW/TheProject.html HTTP/1.1 > > To allow for transition to absoluteURIs in all requests in future > versions of HTTP, all HTTP/1.1 servers MUST accept the absoluteURI > form in requests, even though HTTP/1.1 clients will only generate them in requests to proxies.


bethskurrie
2020-09-25 01:22
dashes? no dashes? This is why I don't do UIs...

bethskurrie
2020-09-25 01:23
Capitals? Capitals look weird with all the other badges that have lowercase imo.

bethskurrie
2020-09-25 01:25
I'm leaning towards `can-i-deploy main foo to prod`

bethskurrie
2020-09-25 01:26
I think that fits the best with the way most badges look.

bethskurrie
2020-09-25 01:27
Now I want a little pact logo at the start of the badge...

bethskurrie
2020-09-25 01:28
Seems like we need to get it into here: https://simpleicons.org/?q=pact

bethskurrie
2020-09-25 01:30
Sigh. According to their "popularity" guidelines, we're not popular enough. https://www.alexa.com/siteinfo/pact.io

bethskurrie
2020-09-25 01:31
We have to be in the top 500K, and we're 666,854

bethskurrie
2020-09-25 01:33
"For anything else, popularity will be judged on a case-by-case basis."

bethskurrie
2020-09-25 01:33
maybe...

tjones
2020-09-25 01:38
My thoughts: * If the badges are long, the pact logo is nice. I don't think the short named badges need logos, but having the logo would be nice especially if there are a few badges for pacts * I like `can-i-deploy: ${X} to ${Y}` - I think a colon after `can-i-deploy` helps separate the content from the what. * I care about the colours - a pet peeve with badges is the non-test badges (eg chat, license etc) not being green. I think green should be used for everything that's either passing or business as usual. That way you can skim the badge colours to see if anything is wrong.

tjones
2020-09-25 01:38
Are consumer / provider names case sensitive? I always assumed they are

bethskurrie
2020-09-25 01:39
nope

tjones
2020-09-25 01:39
I think we could try to trade off the open source nature of Pact

tjones
2020-09-25 01:39
in that case, we could flatten the case

bethskurrie
2020-09-25 01:40
The reason i'd be wary of that is that people do stuff like "MyFooService" which would become "myfooservice"

tjones
2020-09-25 01:40
Something that might be nice is a subtle way to see the difference between a tag and a consumer, eg: `can-i-deploy: foo consumer to PROD`

tjones
2020-09-25 01:40
`can-i-deploy: Foo Consumer to [prod]`

tjones
2020-09-25 01:41
can-i-deploy: Foo Consumer to tag [prod]

tjones
2020-09-25 01:41
something like that

tjones
2020-09-25 01:41
> The reason i'd be wary of that is that people do stuff like "MyFooService" which would become "myfooservice" Yeah. I think I would be a bit annoyed by this, but I think consistency with other badges is nice


tjones
2020-09-25 01:42
Case wise, I think either way is fine

tjones
2020-09-25 01:42
I don't think you need the question mark


bethskurrie
2020-09-25 01:43
not sold on the `:`

tjones
2020-09-25 01:43
I love it and it is great :slightly_smiling_face:

bethskurrie
2020-09-25 01:43
no other badges have a `:`

tjones
2020-09-25 01:43
But also, I don't feel strongly enough about it to argue for it

tjones
2020-09-25 01:43
:shrug:

bethskurrie
2020-09-25 01:44
You can set your own label by adding `?label=xxx`

bethskurrie
2020-09-25 01:44
so anyone can customise it.


bethskurrie
2020-09-25 01:44
I'm wondering if the service name is even needed.

bethskurrie
2020-09-25 01:44
Most times, and badge goes in a readme.

bethskurrie
2020-09-25 01:45
you don't need the name, becasue you know what context you're in already.

tjones
2020-09-25 01:45
What do you think of this? (you can remove the colon if you like)

tjones
2020-09-25 01:45
> you don't need the name, becasue you know what context you're in already. Yes, good point

bethskurrie
2020-09-25 01:45
I actually think that's better.

bethskurrie
2020-09-25 01:45
shorter


bethskurrie
2020-09-25 01:45
any if anyone is putting a bunch of these in a page together, they can customise the label

bethskurrie
2020-09-25 01:46
I like that the red is bigger

bethskurrie
2020-09-25 01:46
but also keen to have the consumer tag in there

tjones
2020-09-25 01:46
Right, yes

tjones
2020-09-25 01:47
I think a good default is whatever is specified

tjones
2020-09-25 01:47
because you can ask can-i-deploy without a tag


tjones
2020-09-25 01:48
Yeah, I wondered about that

tjones
2020-09-25 01:48
the other badges don't read like that

tjones
2020-09-25 01:48
I like it though


tjones
2020-09-25 01:49
^ That's my favourite yet

bethskurrie
2020-09-25 01:49
that's my favourite ^^

bethskurrie
2020-09-25 01:49
lol

tjones
2020-09-25 01:49
bonus points with a pact logo

bethskurrie
2020-09-25 01:49
Are you interested in trying?


bethskurrie
2020-09-25 01:49
It would look so cute!

tjones
2020-09-25 01:56
So to make the request easy for them, we could provide the icon following the steps here: https://github.com/simple-icons/simple-icons/blob/develop/CONTRIBUTING.md#2-extract-the-icon-from-the-logo Is this something we could get one of the Pactflow designers to do? I can then do the leg work with the issue creation

bethskurrie
2020-09-25 01:56
Pact logo, not Pactflow logo

tjones
2020-09-25 01:56
If there isn't capacity, I'll try to find someone to do the resizing

tjones
2020-09-25 01:56
Yes, I know


bethskurrie
2020-09-25 01:57
Michel made this a few years ago

bethskurrie
2020-09-25 01:57
Unfortunately, we don't have any designers at the moment :disappointed:

bethskurrie
2020-09-25 01:57
We're in a big long line with all the other projects

tjones
2020-09-25 01:57
Ah, cool

tjones
2020-09-25 01:57
I'll make it happen :+1:

bethskurrie
2020-09-25 01:57
champion

adrianojedabenitez
2020-09-25 03:17
has joined #pact-broker

yann.courtel
2020-09-25 06:12
Hi everyone, have anyone tried to have some indicators from your PACT Broker ? We'd like to monitor from our testing platform the number of PACT that have failed to validate ? I was wondering if there was an easier way than getting all yours pacts information and iterate through them. Thanks a lot.

bethskurrie
2020-09-25 06:13
Webhooks would be the best way to monitor this


bethskurrie
2020-09-25 06:14
Depending how you want to visualise it, the other way is to make a dashboard of badges https://docs.pact.io/pact_broker/advanced_topics/provider_verification_badges/

yann.courtel
2020-09-25 06:15
Thanks Beth. I meant more as in a quantitative / static form. We would indeed be using this webhook to get information on which provider failed with which consumer on a one and one basis.

bethskurrie
2020-09-25 06:15
hm

bethskurrie
2020-09-25 06:16
tell me exactly what information you're trying to get and how you want to display it.

bethskurrie
2020-09-25 06:16
like, which pacts?

bethskurrie
2020-09-25 06:17
just the ones on your main lines of dev, or all pacts?

bethskurrie
2020-09-25 06:17
which verifications? the ones from the branches, or just the main lines of dev?

yann.courtel
2020-09-25 06:33
the idea first would be all pacts like in the home page of the pact broker but just the total

bethskurrie
2020-09-25 06:38
You want the counts?

bethskurrie
2020-09-25 06:38
You could hit the /dashboard endpoint and count them manually

yann.courtel
2020-09-25 06:44
ok. I will try that, thank you.

yann.courtel
2020-09-25 06:44
I was hitting the /pacts/latest but the information can be quite big

bethskurrie
2020-09-25 06:45
the dashboard will be quite big too

matt.fellows
2020-09-25 06:45
Would our metrics endpoint help? I can?t recall what?s in it

bethskurrie
2020-09-25 06:45
nope

bethskurrie
2020-09-25 06:45
just overall counts

matt.fellows
2020-09-25 06:46
ah

matt.fellows
2020-09-25 06:46
yes, makes sense

bethskurrie
2020-09-25 06:47
if it did, it would also give you a count of every single failed result ever, which is not very helpful :laughing:

bethskurrie
2020-09-25 06:47
it would be interesting to add though

matt.fellows
2020-09-25 06:47
@yann.courtel what we did on a previous project, was wrap the Pact CLI tools (e.g. can-i-deploy) and the verifications and sent data to DataDog to measure all of this

yann.courtel
2020-09-25 06:47
yes that would be ennormous. The dashboard processes the request twice as fast with less info. Thank you

yann.courtel
2020-09-25 06:48
Hey Matt, thanks for the tip. I guess in the end it would be better to do something like that. We have first to do a lot of cleanup in our "unused" pacts before we can move forward though.

slimak2387
2020-09-25 07:11
The issue was resolved by updating PB to newest version - v2.62.0 (2020-09-23)

slimak2387
2020-09-25 07:14
Works fine with newest version - v2.62.0 (2020-09-23). Thank you.

slimak2387
2020-09-25 07:21
Moreover thanks for the educational part of your answer. It's also valuable for me :slightly_smiling_face:

dale.bennett
2020-09-25 07:58
It worked with the upgrade. Didn't pass can I deploy as expected. Thanks! :)

bethskurrie
2020-09-25 09:04
@yann.courtel I'll have a "clean up" feature coming out soon.


yann.courtel
2020-09-25 10:16
Thanks a lot! I'll have a look.

ranjanayush03
2020-09-28 04:27
I have self signed cert on pact-broker, I added the cert and provide the path of it to set the SSL_CERT_FILE so locally in my machine I am able to publish on to the pact broker but when I tried publishing the pact via Jenkins job it is still getting error while publishing pact. ```OpenSSL::SSL::SSLError SSL_connect returned=1 errno=0 state=error: certificate verify failed /export/home/compjenk/workspace/Sirius/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.86.0/pact/lib/vendor/Ruby/2.2.0/gems/pact_broker-client-1.27.0/lib/pact_broker/client/pacts.rb:35:in 'get', attempt 1 of 3.```

ranjanayush03
2020-09-28 04:28
Can someone take a look on this as I have tried any approaches but unable to make it work..

matt.fellows
2020-09-28 04:48
Have you added the certificate and env var to the Jenkins server and made it available to the process that needs to talk to Pact Broker?

ranjanayush03
2020-09-28 04:54
Yes I added the same cert that was allowing me to publish locally but again it is throwing the same error on the Jenkins side..

matt.fellows
2020-09-28 07:40
If it?s working locally, but not on Jenkins, that tells me there is a configuration issue on Jenkins. If you can somehow show the environment variables available to the actual process running the job, the job configuration and the file on disk htat is readible to the process running the job, we may be able to help you. Unfortunately, there are just so many layers to this that you?re likely going to need somebody who has full rights access to the Jenkins machine to debug it for you.

ranjanayush03
2020-09-28 08:08
Yeah Matt thanks a lot will connect with someone who has access and get back to you with the environment variables..

ranjanayush03
2020-09-28 13:47
Thanks Matt on the Jenkins side we had to set that env variable it worked for me thank you..

collin.johnson
2020-09-29 13:58
has joined #pact-broker

raghanag
2020-09-29 17:36
has joined #pact-broker

mark.doppelfeld
2020-09-30 08:43
has joined #pact-broker

mark.doppelfeld
2020-09-30 08:44
Hi

namhuynhkien
2020-09-30 09:26
has joined #pact-broker

bethskurrie
2020-10-01 08:25
Welcome @mark.doppelfeld

robert.strehli
2020-10-01 13:21
Hi, I have a little problem with log investigation. I'm currently testing a webhook which response is always `An error has occurred. The details have been logged with the reference ekibGESyAN` I'm not really able to find the correct logs for details. There is nothing in the pact broker log (it's on DEBUG level) and in the container I don't find any additional logs. I'm using the `dius/pact-broker` . Could someone give me a hint?

evman182
2020-10-01 14:37
Hi, we are getting internal server errors from the broker.

evman182
2020-10-01 14:38
The error is `Error reference zJVdpSHICG - Sequel::PoolTimeout timeout: 5.0, elapsed: 5.0001413689460605` and it looks like the underlying call in the broker is `find_latest_pact`

evman182
2020-10-01 14:40
looks like we're on v2.51.0

antonello
2020-10-01 15:11
Hi @evman182. Can I how you?re running the broker and the database?

antonello
2020-10-01 15:12
also - any idea of how big your database is? for examples, how many rows does the `versions` table have?

evman182
2020-10-01 15:12
in AWS, in ECS and RDS

evman182
2020-10-01 15:13
need a sec to check the database

antonello
2020-10-01 15:15
We had similar problems around pool timeouts, driven by expensive queries and an increase in concurrent requests

evman182
2020-10-01 15:16
2,344 rows in the `versions` table

antonello
2020-10-01 15:19
There are two environment variables `PACT_BROKER_DATABASE_MAX_CONNECTIONS` `PACT_BROKER_DATABASE_POOL_TIMEOUT` Which might help

evman182
2020-10-01 15:20
it seems like those were added to a later version, so we'd have to upgrade (which we may have to do anyway)

antonello
2020-10-01 15:20
yes

antonello
2020-10-01 15:20
> 2.58.0.1


antonello
2020-10-01 15:22
Fundamentally, some of queries are pretty heavy

antonello
2020-10-01 15:22
the more data, the worse.

antonello
2020-10-01 15:22
@bethskurrie is working on some kind of smart, automated clean-up

evman182
2020-10-01 15:23
ok. Didn't know if there was an index or something that could be added, but I didn't see anything like that in the changelogs for later versions

antonello
2020-10-01 15:23
Sadly not. We have been battling with performance from the start.

antonello
2020-10-01 15:24
We have to run a clean-up to every 1-2 months or otherwise it becomes painfully slow

evman182
2020-10-01 16:06
a cleanup of old versions?

evman182
2020-10-01 16:06
and is over 2300 a lot?

antonello
2020-10-01 16:07
it doesn?t sound like a lot

evman182
2020-10-01 16:08
:disappointed:

matt.fellows
2020-10-01 23:51
hmm that?s interesting

matt.fellows
2020-10-01 23:52
are there a lot of versions for a single integration perhaps? We have lots of customers with 1000s of versions and don?t see those sorts of issues

matt.fellows
2020-10-01 23:52
but they may be spread across many integrations. It would be helpful to know that

matt.fellows
2020-10-01 23:52
I?m sure Beth might have other questions too

matt.fellows
2020-10-01 23:52
We also use the same stack Evan

evman182
2020-10-01 23:52
lol, probably my project cause my team publishes on every merge into our development branch

evman182
2020-10-01 23:53
we upgraded to the latest, and set the connection pool size env variable to 20. So far it's stayed up. What we don't know is if the issue was the DB, or that we should have scaled up to more than 1 container

evman182
2020-10-01 23:54
or if upping the connection pool size is fine

matt.fellows
2020-10-01 23:55
> lol, probably my project cause my team publishes on every merge into our development branch publishing is different to versions. From what I?ve seen, it?s not uncommon to have 50k publications or more

evman182
2020-10-01 23:55
also assuming 1GB of memory is enough

matt.fellows
2020-10-01 23:55
it?s only if the contract is continualy different where it will have more cotnract versions

matt.fellows
2020-10-01 23:55
> also assuming 1GB of memory is enough for the app or DB?

evman182
2020-10-01 23:56
the app

matt.fellows
2020-10-01 23:56
?it depends? :slightly_smiling_face:

matt.fellows
2020-10-01 23:56
are you using the alpine variant? If so, it might be enough

matt.fellows
2020-10-01 23:57
but that sounds like you?re probably using a `t2` or `t3` style instance, so that may have performance issues depending on how it?s used

evman182
2020-10-01 23:57
it's ECS, not EC2

matt.fellows
2020-10-01 23:57
ECS still has instances, unless you?re using fargate

matt.fellows
2020-10-01 23:58
Go to your RDS console and see if you can extract the slow queries and show memory/cpu usage there - it seems more likely the DB that is the bottleneck, not the app

evman182
2020-10-01 23:59
and we're using the pactfoundation/pact-broker image

evman182
2020-10-02 00:01
EC2 style ECS

matt.fellows
2020-10-02 00:02
Cool, do you know what instances you have?

matt.fellows
2020-10-02 00:03
I?ll level with you - we use `t3` instances in production, so it?s unlikely to be that

matt.fellows
2020-10-02 00:03
(on ECS)

evman182
2020-10-02 00:04
r5a.8xlarge

evman182
2020-10-02 00:09
we don't have slow query logging on as far as I can tell

evman182
2020-10-02 00:11
>are there a lot of versions for a single integration perhaps how would I check this

evman182
2020-10-02 00:11
count rows per participant_id?

matt.fellows
2020-10-02 00:35
mm something like that

matt.fellows
2020-10-02 00:35
I?m assuming your multi-tenant hosting the broker with other workloads on ECS, right?

matt.fellows
2020-10-02 00:35
If not - you?re spending too much! :stuck_out_tongue:

evman182
2020-10-02 00:36
lol, yea. There's an enormous number of containers running

evman182
2020-10-02 00:36
here's the top 10 participants

matt.fellows
2020-10-02 00:37
So I can?t debug your container resource contention - it may be a possibility

matt.fellows
2020-10-02 00:38
it?s more likely the DB slow running queries

matt.fellows
2020-10-02 00:38
those numbers don?t look big to me

evman182
2020-10-02 00:38
if we run into issues again, I'll talk to our cloud team about turning on logging for that RDS cluster

matt.fellows
2020-10-02 00:38
I?ll be honest, I?m not qualified to tell you the specific application queries off the top of my head - so I don?t want to give you bad advice

matt.fellows
2020-10-02 00:38
but my gut feel is it?s the RDS to start with

antonello
2020-10-02 02:41
One of questions we?ve had on our side is whether we are the only ones battling with performance issues.

bethskurrie
2020-10-02 02:52
@evman182 those do not look like big numbers

bethskurrie
2020-10-02 02:53
I'm surprised you've having such issues.

bethskurrie
2020-10-02 02:53
I'm no DBA - I've just done as well as I can over the years, and I've learned a lot as I've gone. It is quite possible that if a DBA looked at some of the queries, they'd be able to give me some easy fixes.

bethskurrie
2020-10-02 02:54
I'll be honest - in OSS, I've never come across a DBA who wanted to contribute.

bethskurrie
2020-10-02 02:57
If you'd like me to help, you're going to have to upgrade to the latest version, as I can't do any query optimisation on an old version. Set the ```PACT_BROKER_SQL_LOG_WARN_DURATION``` so that we can start to identify the slowest queries.

bethskurrie
2020-10-02 03:00
I am reasonably familiar with the slow queries that we get on Pactflow, and it's not the "find latest pact" one.

bethskurrie
2020-10-02 03:00
I wonder if you were on a very old version?

antonello
2020-10-02 03:01
He was on 2.51.0

antonello
2020-10-02 03:01
But upgraded to the latest yesterday so that he could change the size of the connection pool

bethskurrie
2020-10-02 03:02
Not super old.

bethskurrie
2020-10-02 03:03
But really, with a few hundred versions for a pacticipant, I can't see how finding any row could take more than 5 seconds.

bethskurrie
2020-10-02 03:03
There's something else going on that I don't understand.

evman182
2020-10-02 03:06
it's possible that that wasn't the slow query, and that that's just the query that was running when we got the error

evman182
2020-10-02 03:06
I'll look at that env variable.

bethskurrie
2020-10-02 03:06
True. If there was something else running already that was slow.

bethskurrie
2020-10-02 03:07
These are the specs we recommend for the on-prem pactflow https://docs.pactflow.io/docs/on-premises/system-requirements/

evman182
2020-10-02 03:08
I'm decent with dbs, but I don't know ruby at all. If you know the raw sql that gets generated that runs slowly, I can take a look at that and the schema and see if anything pops out to me

bethskurrie
2020-10-02 03:08
If you continue to find issues, then you can do a dump of your db, and anonymise it using this script https://github.com/pact-foundation/pact_broker/blob/master/script/prod/redact-data.sql

bethskurrie
2020-10-02 03:09
I can never recreate performance issues on my mac because it's too fast, but I've put stuff in a docker container before and deliberately under-speced it.

bethskurrie
2020-10-02 03:10
The slow queries logging should help

matt.fellows
2020-10-02 03:11
> One of questions we?ve had on our side is whether we are the only ones battling with performance issues. Anto - probably not!

bethskurrie
2020-10-02 03:11
You're probably the ones who are talking about it!

bethskurrie
2020-10-02 03:16
However, we've been running Pactflow for 5 years, and haven't cleaned out anyone's databases.

bethskurrie
2020-10-02 03:16
I don't think we're using a crazily powerful DB are we @matt.fellows?

evman182
2020-10-02 03:20
I realized I saw earlier today where another team in my company might be publishing consumer pacts and provider verification results on every CI run. I should make sure that's not widespread. if we're under a lot of extra load, that could be a reason

bethskurrie
2020-10-02 03:20
IT's expected to be publishing every ci run

bethskurrie
2020-10-02 03:21
It would be super bad not to.

evman182
2020-10-02 03:21
for any branch and PRs? I would think just when you merge into your default branch

bethskurrie
2020-10-02 03:21
@robert.strehli you're looking in the right places.

bethskurrie
2020-10-02 03:22
You're seeing other logs, yes?

bethskurrie
2020-10-02 03:23
Are you on the latest version of the broker?

antonello
2020-10-02 03:24
We publish and verify on every single CI build for all branches.

bethskurrie
2020-10-02 03:24
Can you give more details? Are you testing using the POST request to do the test execution, or are you seeing this in the actual logs when you publish a pact?

bethskurrie
2020-10-02 03:25
Publishing a pact from a branch is the way to make any new requested features available to the provider to verify

bethskurrie
2020-10-02 03:25
the pact should already be verified by the time you merge your branch into master.

antonello
2020-10-02 03:25
Otherwise how would you know if your pact is fine once you merge?



bethskurrie
2020-10-02 03:28
The error you're seeing is strange, because it means there's been an actual runtime error, not just an HTTP error.

bethskurrie
2020-10-02 03:29
Are you able to share the webhook json?

evman182
2020-10-02 03:29
those are new features this year, right?

bethskurrie
2020-10-02 03:30
which ones?

bethskurrie
2020-10-02 03:31
the links I sent were just about process, rather than features.


bethskurrie
2020-10-02 03:32
the recommended way to add new stuff to a pact is to do it on a branch of the consumer (if you use branch based dev), publish the pact, get the provider to add and release the new features, then merge in the consumer branch.

bethskurrie
2020-10-02 03:34
Back to the "publishing every build" thing. The broker de-dupes the pact contents, so unless you're putting random data into your pacts, publishing the same pact over and over again doesn't hurt at all.

evman182
2020-10-02 03:34
I'll have to dig in. I guess I misunderstood the process. We always verify on every run, but the verification isn't published until we merge. And the consumer pacts aren't published until the PR is merged either

bethskurrie
2020-10-02 03:34
are you using tags?

evman182
2020-10-02 03:35
I don't think so

bethskurrie
2020-10-02 03:35
ok, that'll be why you're doing it the way you're doing it.

bethskurrie
2020-10-02 03:36
Can I recommend you read https://docs.pact.io/pact_nirvana

evman182
2020-10-02 03:36
will do

bethskurrie
2020-10-02 03:36
especially the bit on "5. Allow contracts to change without breaking your builds"

bethskurrie
2020-10-02 03:37
tags allow you to publish from every branch, for every build without getting your resources mixed up.

bethskurrie
2020-10-02 03:37
if you didn't use tags, then when you publish from a branch, it would override the latest pact from master.

bethskurrie
2020-10-02 03:38
ok, gtg, but please let me know what you're finding in the logs for the slow queries. They'll be logged at WARN.

robert.strehli
2020-10-02 07:30
well I checked the broker container logs and also the logs in `/var/log/nginx/` It seems to be I'm on a older version `2.59.2` , so I'll try to update it Yeah correct I'm using the POST request to do the test execution

robert.strehli
2020-10-02 07:30
That's the json

bethskurrie
2020-10-02 09:58
Ok, so I've tried to see what would happen if there was a run time error executing a webhook.

bethskurrie
2020-10-02 09:58
I've put a deliberate "raise error" in the process method.

bethskurrie
2020-10-02 09:59
I've definitely got a log

bethskurrie
2020-10-02 09:59
```E, [2020-10-02T19:57:18.530994 #3609] ERROR -- : -- Error reference HmYvXXuZBq -- Exception: RuntimeError: bethtest /Users/bethanyskurrie/workspace/pact-foundation/pact_broker/lib/pact_broker/api/resources/webhook_execution.rb:29:in `process_post'```

bethskurrie
2020-10-02 10:02
Can you see if you can recreate the issue using this docker compose @robert.strehli? https://github.com/DiUS/pact_broker-docker/blob/master/docker-compose.yml

bethskurrie
2020-10-02 10:08
There was a fix to a line in the logging here https://github.com/pact-foundation/pact_broker/commit/80a895bf

bethskurrie
2020-10-02 10:08
But it's in v2.59.2, which is what you say you have.

bethskurrie
2020-10-02 10:10
If you can recreate it with that docker-compose, please raise an issue in the pact-foundation/pact_broker repo.


robert.strehli
2020-10-02 10:12
Thanks I'll try it out

robert.strehli
2020-10-02 10:38
Hmm I have a problem with this docker compose file. ``` - ./ssl/nginx.conf:/etc/nginx/conf.d/default.conf:ro``` There is a problem with mounting the volumes. Should the goal not be a directory?

bethskurrie
2020-10-02 20:12
That's strange @robert.strehli. I can see `process_linux.go`. Are you running it on linux? Maybe there's a difference between docker-compose on linux and docker-compose on mac (which is what I'm on).

bethskurrie
2020-10-02 20:15
It is mounting a file to a file. `./ssl/nginx.conf:/etc/nginx/conf.d/default.conf` is the mapping, and `:ro` is the mode.


bethskurrie
2020-10-02 20:16
What version of docker-compose are you running? I'm on `docker-compose version 1.27.2, build 18f557f9`

mateusz.derks
2020-10-03 08:08
has joined #pact-broker

mateusz.derks
2020-10-03 08:28
Hey, I'm still wrapping my head around webhooks and verification. If we verify pact on the contract change, how do we rerun verificatiom when the contract is not changed, but a new version of provider is released? Example: I have a pre-production version of consumer that changes a contract. I publish the pact file, the broker detects a contract change and we run verification. Everything is green. Before this change lands on production a new version of provider is shipped. Now there is no verification between the pre-production pact file and the new provider. `can-i-deploy` says the verification is missing and we cant deploy the change. Is the any way to automate re-verification?

matt.fellows
2020-10-03 08:35
One option would be to also use the WIP pacts feature on the provider side, so that the new contracts are automatically validated (but won't fail the provider if they're not compatible)

mateusz.derks
2020-10-03 08:40
Oh, didnt know about that feature, thanks for the hint :+1:

matt.fellows
2020-10-03 08:45
It's a fair question tho!

bethskurrie
2020-10-04 22:07
@mateusz.derks are you running the verifications in the provider build as well?

bethskurrie
2020-10-04 22:08
The verifications run both when the contract changes, and *every time there is a provider build.*




robert.strehli
2020-10-05 08:15
Yes, I'm running it on a linux machine and I have a much older docker-compose version `1.23.2` . Hmm I assumed that only mounting to a directory is possible, but yeah the docs say otherwise. I'll update everything :slightly_smiling_face: and check if the problem still exists.

nazar.khmil
2020-10-05 10:34
has joined #pact-broker

xandebianchi
2020-10-05 13:05
has joined #pact-broker

dorin.enache
2020-10-05 15:01
has joined #pact-broker

michael_james
2020-10-06 10:01
has joined #pact-broker

ledinhcuong99
2020-10-06 12:53
has joined #pact-broker

ruth
2020-10-06 13:52
has joined #pact-broker

bethskurrie
2020-10-07 02:34
Moving thread from @phil.endsley regarding code changes to remove selectors for feature branches here.


bethskurrie
2020-10-07 02:35
Are you asking because you're not currently using WIP pacts, and you're interested, or because you are using WIP pacts and it's not behaving in a way that works for you?

bethskurrie
2020-10-07 02:35
Here are the docs https://docs.pact.io/wip (they need a bit more detail, but I'm waiting to see how this recent change goes first).

phil.endsley
2020-10-07 02:37
We're using wip pacts, but it's not working in the most ideal way :slightly_smiling_face: I'll outline what we're doing

phil.endsley
2020-10-07 02:41
1. Create feature branch in consumer. Publish pact 2. Create feature branch in provider. Add a consumer version selector that "points" to the new pact 3. Once verified, make a code change to remove the new selector and merge the provider 4. Merge the consumer Ideally, we don't want to make an additional commit to remove the consumer version selector The reason we have to have the consumer version selector, is because we typically have multiple revisions to the provider. So, if the provider verifies the consumer on the first commit, it's no longer WIP and won't be verified with subsequent revisions, unless there's a consumer version selector for the consumer feature branch

bethskurrie
2020-10-07 02:42
yup, this should fix that

bethskurrie
2020-10-07 02:42
i wrote a test explicitly for this scenario

phil.endsley
2020-10-07 02:42
excellent :heart:

bethskurrie
2020-10-07 02:42
let me find it and you can see if it matches

phil.endsley
2020-10-07 02:42
I know there have been a few others that have asked about this scenario as well


phil.endsley
2020-10-07 02:43
I'll read through it again in the morning to verify. But my gut feeling from reading through the other thread was that this would fix it

bethskurrie
2020-10-07 02:43
actually, this is not quite your scenario, because you're not using matching feature branches


phil.endsley
2020-10-07 02:44
Correct, we don't have matching feature branches

bethskurrie
2020-10-07 02:44
it'll stay wip until it's explicitly selected.

bethskurrie
2020-10-07 02:44
(and successfully verified)

bethskurrie
2020-10-07 02:45
so you actually don't want to change your selectors.

phil.endsley
2020-10-07 02:45
Right. That was our original desire. Now we can set them once and not touch them

bethskurrie
2020-10-07 02:45
that's the goal

bethskurrie
2020-10-07 02:46
damn it's been hard to make this behave intuitively! I wasn't sure at the outset if it was going to even be possible, and i'm still not 100% sure!

phil.endsley
2020-10-07 02:46
@bethskurrie :taco::taco: and many more. Seriously amazing work you put into this

bethskurrie
2020-10-07 02:46
I'm not going to officially release this until I've had feedback from Robbert, but I can put out an edge version of the docker image if you want to try it out yourself.

bethskurrie
2020-10-07 02:47
Thanks Phil.

bethskurrie
2020-10-07 02:48
an interesting side effect of keeping a pact WIP for longer is that it is actually WIP but no longer pending any more.

bethskurrie
2020-10-07 02:48
This means a WIP pact could fail the build, if you verified it successfully and then had a regression.

bethskurrie
2020-10-07 02:49
Question - do we want this, or should I change the definition of "pending" to match the new WIP definition?

phil.endsley
2020-10-07 02:49
haha idk...I feel like I have to explain both definitions to my org every other day as is :smile:

bethskurrie
2020-10-07 02:50
I know. it's bloody hard to understand.

bethskurrie
2020-10-07 02:50
I don't mean, definition in terms of the words.

bethskurrie
2020-10-07 02:50
I mean in terms of the code.

phil.endsley
2020-10-07 02:50
The terminology doesn't trip me up. The behavior is what I would expect. If I've verified a pact, I want it to fail subsequent builds if verification fails

bethskurrie
2020-10-07 02:50
even if it is being brought in as a WIP pact?

phil.endsley
2020-10-07 02:51
yes. In my mind, if a pact is verified, any failure after that should fail the provider build

phil.endsley
2020-10-07 02:52
Because it indicates a regression with the provider

bethskurrie
2020-10-07 02:52
:thumbsup::skin-tone-3:

bethskurrie
2020-10-07 02:53
I was thinking of describing the transition of "pending" to "not pending" like a ratchet. It can only go one way. Do you think that's a helpful simile or not?

phil.endsley
2020-10-07 02:56
It doesn't click with me, so I wouldn't use it when explaining pending

bethskurrie
2020-10-07 02:56
righto, thanks

phil.endsley
2020-10-07 02:58
RE: Edge broker docker image, I'd be willing to test it out

phil.endsley
2020-10-07 03:18
I'm not 100% sure if this will be ideal now :confused: When implementing changes on the provider, I think we'll still have to add a selector for the feature branch...if we don't, we'll have all wip pacts running locally, and the tests won't fail (since they're all pending). If we don't have pending enabled, we'll fail for parallel feature branches that we truly don't want If we do have it, it's hard to iterate on the tests until we see them pass Then after that, we need to remember to revert the selector before committing and pushing, otherwise it will be explicitly selected, and no longer wip :thinking_face:

bethskurrie
2020-10-07 03:20
hm

phil.endsley
2020-10-07 03:20
I think I'll just have to mess around with it once it's out to know for sure. But my concern would be introducing something devs have to remember for this to work

phil.endsley
2020-10-07 03:21
ideal for our specific use case*

bethskurrie
2020-10-07 03:22
so, you don't want all the wip pacts pulled in on a feature branch?

phil.endsley
2020-10-07 03:23
When running in CI, it's fine. When running locally, not particularly

bethskurrie
2020-10-07 03:23
when running locally, I just give it the pact URL that i care about.

bethskurrie
2020-10-07 03:23
what's your provider language?

phil.endsley
2020-10-07 03:23
java

bethskurrie
2020-10-07 03:23
hm. ok, I don't know how to do that one.

bethskurrie
2020-10-07 03:24
but I believe it's possible, because webhooks.

phil.endsley
2020-10-07 03:24
hmm...I can explore that more too

bethskurrie
2020-10-07 03:25
So, I have my provider code configured so that it looks for the PACT_URL env var. If it finds it, then it just verifies that pact. if it doesn't, it assumes it's a normal verification run, and verifies the standard selectors.

bethskurrie
2020-10-07 03:25
this is how I run my webhooks.

phil.endsley
2020-10-07 03:25
So, do you set the url in the code, or through an env var locally? If in the code, do you just revert it before committig/merging

bethskurrie
2020-10-07 03:25
locally.

bethskurrie
2020-10-07 03:25
env var. no change to code.


bethskurrie
2020-10-07 03:26
But, I don't know how it works in java.

phil.endsley
2020-10-07 03:26
hmm...I have a lot to play around with tomorrow :slightly_smiling_face:

bethskurrie
2020-10-07 03:27
you should just be able to verify one interaction as well. in ruby/js etc you use an env var to set the interaction ID, but again, I don't know how to java.

phil.endsley
2020-10-07 03:28
I'm also a little hesitant to jump on board with that approach when I'm trying to convince our whole company to do it. I just know the more complicated things are to do something, the less likely people will want to do it

bethskurrie
2020-10-07 03:28
true.

phil.endsley
2020-10-07 03:28
And "complicated" depends on who you're talking to

bethskurrie
2020-10-07 03:29
I think in your situation, I would have my `enableWipPacts` date only set for your main branch.

bethskurrie
2020-10-07 03:30
if you want to avoid bringing them in on feature branches.

bethskurrie
2020-10-07 03:30
And I would recommend the "matching feature branch" stategy.

bethskurrie
2020-10-07 03:30
then you don't have to change selectors.

phil.endsley
2020-10-07 03:31
Yeah... unfortunately, that won't work. Company policies and existing workflows

bethskurrie
2020-10-07 03:31
`{tag: ENV['BRANCH'], fallbackTag: 'main', latest: true}`

bethskurrie
2020-10-07 03:31
ah well.

phil.endsley
2020-10-07 03:31
Branches have to have jira tickets, and project names are different

bethskurrie
2020-10-07 03:32
righto. I think you might be stuck with explictly setting the tags then.

phil.endsley
2020-10-07 03:32
Regex matching was my first proposal around this. Wrote an item up in canny

bethskurrie
2020-10-07 03:32
ah yes, I remember

phil.endsley
2020-10-07 03:34
The good news is devs see the value and adoption rate is super high. Enough value that they're all willingly putting up with the tedious extra commit. Pact has already caught many bugs between our teams. Would've been caught by qa, but it's saved us on all the churn/back and forth

bethskurrie
2020-10-07 03:35
:heart:

bethskurrie
2020-10-07 03:35
it makes me so happy to hear that.

bethskurrie
2020-10-07 03:36
Can we put that quote somewhere?

bethskurrie
2020-10-07 03:36
Can be anonymous, but even better if we can say who it is.

phil.endsley
2020-10-07 03:37
Quote, yes. Would have to clear it with company before attaching their name to it, but I can ask

bethskurrie
2020-10-07 03:37
That would be super awesome. We'd appreciate it.

bethskurrie
2020-10-07 03:39
We have some quotes on the pactflow website here, and we're suckers for more!

matt.fellows
2020-10-07 03:47
@phil.endsley would a bribery :taco: help? :stuck_out_tongue:

phil.endsley
2020-10-07 03:48
I'm fine with MY name attached to it. Just have to cover myself before attaching my org to it :sweat_smile:

bethskurrie
2020-10-07 03:48
of course.

antonello
2020-10-07 06:21
I haven?t read everything, but... what CI system do you use @phil.endsley ?

dothetan.040490
2020-10-07 09:14
has joined #pact-broker

phil.endsley
2020-10-07 11:46
Bamboo

antonello
2020-10-07 11:47
does that allow you to parameterise you pipelines? I was wondering if you could specify the consumer tags on demand, when necessary (including the corresponding feature tag)

phil.endsley
2020-10-07 12:38
We can, but we don't know what the feature tag is up front. We would have to edit the config for the plan to run it, or kick it off manually, right?

antonello
2020-10-07 12:39
mm. yeah

antonello
2020-10-07 12:40
we tend to use the convention of using the same branch name for consumer and provider if we need to do cross-branch testing.

phil.endsley
2020-10-07 12:43
That sounds like what would work best for us. Our issue is we have to reference our ticket number in the branch name so a bunch of other integrations work. So, we'll have feature/PROJ-1-some-new-feature (consumer) and feature/PROJ-2-some-new-feature (provider). If it's possible to add pattern matching for tags, we could just ignore the prefix and match on the suffix

antonello
2020-10-07 12:43
Similar challenges here

antonello
2020-10-07 12:43
I wonder if you could somehow keep a mapping of consumer tag and provider tag outside of the provider repo

antonello
2020-10-07 12:43
maybe centralised

antonello
2020-10-07 12:46
which could be made accessibile to the provider pipelines via a script (in Jenkins it would be a share library, for example)

dagostino.remy
2020-10-07 23:03
has joined #pact-broker

abhi.nandan
2020-10-08 06:38
has joined #pact-broker

mateusz.derks
2020-10-08 07:50
Hi @bethskurrie yes, we run the verification in the pact provider build. So far we do a verification using a manual list of consumer for the provider ```Pact.service_provider(provider) do honours_pact_with(consumer) do ... end end``` From what I understand to use WIP pacts verification I need to switch to ```Pact.service_provider(provider) do honours_pact_with_broker do .. end end``` is that right?

mateusz.derks
2020-10-08 07:51
I couldn?t find it documented, just dig from the pact-ruby repo

mateusz.derks
2020-10-08 07:56
The verification run when our provider is built used to point to the production tag of the consumer, that?s why our main, unreleased branch of the consumer was never verified agains the newly released provider.

mateusz.derks
2020-10-08 08:26
I find this discussion very relevant to what we try to achieve https://pact-foundation.slack.com/archives/C5F4KFKR8/p1601808591170800

rarora
2020-10-08 11:54
has joined #pact-broker

przemyslaw.dabrowski
2020-10-08 12:36
has joined #pact-broker

emiliano.righi
2020-10-08 13:25
has joined #pact-broker

cariaga.bh
2020-10-08 21:03
has joined #pact-broker


bethskurrie
2020-10-08 22:20
I'm in the process of moving them from the wiki.

bethskurrie
2020-10-08 22:20
You should be verifying the latest one from your main line of development as well as the master one.

bethskurrie
2020-10-08 22:21
Ideally, one for every test envionment.

bethskurrie
2020-10-08 22:21
Funnily enough, I just wrote this the other day https://docs.pact.io/provider/recommended_configuration

bethskurrie
2020-10-08 22:24
@robert.strehli have you had a chance to look at this?

campellcl
2020-10-09 00:06
has joined #pact-broker

mateusz.derks
2020-10-09 04:57
Amazing, thats exactly what I need, not sure how did I miss it, thanks @bethskurrie

bethskurrie
2020-10-09 04:57
Because I only just added it

bethskurrie
2020-10-09 05:43
@mateusz.derks if you worked through this, you'd get to the same result https://docs.pact.io/pact_nirvana

elenitsaa043
2020-10-09 10:00
has joined #pact-broker

adriangabrieloros
2020-10-09 11:05
has joined #pact-broker

robert.strehli
2020-10-09 11:07
Hey, yes and no. I updated docker-compose to `1.27.4` but I still got the problem with the volumes. Unfortunately I hadn't the time to investigate this problem further. Maybe next week.

ranjanayush03
2020-10-09 11:32
Hello everyone I was trying to run the pact-broker-cli docker image but was unable to do that I tried using the Ruby standalone one it worked for me but it would be really helpful if there is any example on running the same via docker image I tried. ''' docker run --rm pactfoundation/pact-cli broker publish''' command but it didn't work for me..

matt.fellows
2020-10-09 11:33
can you please post exactly the command you ran (with confidential details redacted) so we can help?

ranjanayush03
2020-10-09 11:34
Yeah sure Matt

ranjanayush03
2020-10-09 11:36
docker run --rm pactfoundation/pact-cli broker publish PACTFILES -a 1.21.0 -b http://localhost:9292

ranjanayush03
2020-10-09 11:37
localhost 9292 is where the pact broker is running

ranjanayush03
2020-10-09 11:37
Failed to command :/pact/bin/pact I am getting as error

matt.fellows
2020-10-09 11:40
can you please paste the full output here in code gates?

matt.fellows
2020-10-09 11:40
(also, are you sure you can reach `localhost` from within the docker container? I?m doubtful)

ranjanayush03
2020-10-09 11:46
Yes while running the standalone code I am able to access the localhost

matt.fellows
2020-10-09 11:47
can you reach localhost from the docker command?

matt.fellows
2020-10-09 11:50
TL;DR - localhost from within a docker container is not the localhost that the Ruby standalone is talking to. I can?t teach you docker here I?m afraid, but if you?re on a mac you can reach the Docker host (probably the `localhost` where the broker is running) via `docker.for.mac.localhost` see https://dev.to/noelworden/accessing-localhost-within-a-docker-image-4i3m

matt.fellows
2020-10-09 11:50
There are probably equivalents for others

ranjanayush03
2020-10-09 11:51
Thanks Matt will look into this..

matt.fellows
2020-10-09 11:52
but, before you do that, you mentioned it can?t execute a binary? that needs to be fixed first

ranjanayush03
2020-10-09 11:53
Yes I am sending the error logs

ranjanayush03
2020-10-09 11:55
''' Errno::ENOENT: No such file or directory @ rb_sysopen - /Users/Shared/workspace/contract-testing-service/build/pacts /usr/lib/ruby/gems/2.5.0/gems/pact_broker-client-1.29.1/lib/pact_broker/client/pact_file.rb:32:in `read' /usr/lib/ruby/gems/2.5.0/gems/pact_broker-client-1.29.1/lib/pact_broker/client/pact_file.rb:32:in `read' /usr/lib/ruby/gems/2.5.0/gems/pact_broker-client-1.29.1/lib/pact_broker/client/pact_file.rb:28:in `pact_hash' /usr/lib/ruby/gems/2.5.0/gems/pact_broker-client-1.29.1/lib/pact_broker/client/pact_file.rb:16:in `pact_name' /usr/lib/ruby/gems/2.5.0/gems/rake-13.0.1/lib/rake/file_list.rb:79:in `each' /usr/lib/ruby/gems/2.5.0/gems/rake-13.0.1/lib/rake/file_list.rb:79:in `group_by' /usr/lib/ruby/gems/2.5.0/gems/rake-13.0.1/lib/rake/file_list.rb:79:in `group_by' /usr/lib/ruby/gems/2.5.0/gems/pact_broker-client-1.29.1/lib/pact_broker/client/publish_pacts.rb:41:in `publish_pacts' /usr/lib/ruby/gems/2.5.0/gems/pact_broker-client-1.29.1/lib/pact_broker/client/publish_pacts.rb:27:in `call' /usr/lib/ruby/gems/2.5.0/gems/pact_broker-client-1.29.1/lib/pact_broker/client/publish_pacts.rb:13:in `call' /usr/lib/ruby/gems/2.5.0/gems/pact_broker-client-1.29.1/lib/pact_broker/client/cli/broker.rb:213:in `publish_pacts' /usr/lib/ruby/gems/2.5.0/gems/pact_broker-client-1.29.1/lib/pact_broker/client/cli/broker.rb:59:in `publish' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start' /usr/lib/ruby/gems/2.5.0/gems/pact_broker-client-1.29.1/lib/pact_broker/client/cli/custom_thor.rb:15:in `start' /pact/lib/pact/cli.rb:40:in `broker' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch' /usr/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start' /pact/bin/pact:15:in `<top (required)>' '''

matt.fellows
2020-10-09 11:57
that error is pretty clear - the docker container in which you?re running the command can?t find that file.

matt.fellows
2020-10-09 11:57
you?re not mapping the volume f rom the host to the container


matt.fellows
2020-10-09 11:57
see the `-v` flag

ranjanayush03
2020-10-09 12:04
Yeah Matt thanks a lot.

joel.whalen
2020-10-09 17:57
@bethskurrie stumbling upon this issue myself just now - I see there are examples on how to construct the `verificationOptions` object, but how do I pass these options to the pact-cli with the `--consumer-version-selector` option?

sh.ilgam_pact
2020-10-11 16:13
has joined #pact-broker

bethskurrie
2020-10-12 00:02
@joel.whalen if you're talking about the verificationOptions examples you've seen in javascript, you'll find a CLI option for each of the keys.


ranjanayush03
2020-10-12 10:58
Hello all.. actually I am trying to fetch pact from a URL via @PactUrl notation but I guess the API which I am calling needs some authorization so I was unable to find a way so as to include the headers .. Any help will be much appreciated..

antonello
2020-10-12 11:00
I assume you?re using Java?

ranjanayush03
2020-10-12 11:02
Yes I am using java

anastasiia.bielik
2020-10-12 11:13
has joined #pact-broker

deepika.krishnakumar
2020-10-12 15:03
has joined #pact-broker

bethskurrie
2020-10-12 22:08
@ranjanayush03 you'll need to ask in #pact-jvm

anbansal27
2020-10-12 23:02
has joined #pact-broker

krisdinesh
2020-10-13 00:43
has joined #pact-broker

krisdinesh
2020-10-13 00:50
Hello - I am trying to run a pact foundation broker image with a standalone postgres but it says no adapter found. not sure what is the issue

bethskurrie
2020-10-13 00:51
I was just looking at your file and it disappeared!

matt.fellows
2020-10-13 00:52
can you please share your config?

krisdinesh
2020-10-13 00:52
sorry it was exposed with connection string. Hence updated with another screenshot

matt.fellows
2020-10-13 00:53
I?m guessing you?ve put ?driver? as the name of the driver to use

bethskurrie
2020-10-13 00:53
Looks like you have the PACT_BROKER_DATABASE_ADAPTER env var set incorrectly

matt.fellows
2020-10-13 00:53
I think it should be something more like ?postgres? or ?mysql? (off the top of my head)

bethskurrie
2020-10-13 00:53
yeah, I can see it at the top of the shot

matt.fellows
2020-10-13 00:54
ah yes

bethskurrie
2020-10-13 00:54
should be `postgres://` not `driver://`

krisdinesh
2020-10-13 00:54
oh...

bethskurrie
2020-10-13 00:54
what are you copying from?

bethskurrie
2020-10-13 00:54
do we need to update an example that is confusing?

krisdinesh
2020-10-13 00:55
its not confusing, i made a blunder mistake

krisdinesh
2020-10-13 00:55
I am following readme

krisdinesh
2020-10-13 00:56
Thanks Beth and Matt

krisdinesh
2020-10-13 00:56
@bethskurrie /@matt.fellows - Is there any sample repo that i can refer Kubernetes pack broker setup?

bethskurrie
2020-10-13 00:57
Not an official one, but if you google you might find one someone else made


krisdinesh
2020-10-13 01:01
PACT_BROKER_DATABASE_POOL_TIMEOUT is this variable in ms or secs?

bethskurrie
2020-10-13 01:01
I would leave it as it is unless you have issues.

bethskurrie
2020-10-13 01:02
the docs say : "`PACT_BROKER_DATABASE_POOL_TIMEOUT` - optional, 5 seconds by default. The number of seconds to wait if a connection cannot be acquired before raising an error."

krisdinesh
2020-10-13 01:03
i have slow database response....so i am trying to check

bethskurrie
2020-10-13 01:03
Are those docs not clear?

bethskurrie
2020-10-13 01:03
If you need to set that and you don't have any data in your database yet, you have other issues.

matt.fellows
2020-10-13 01:04
5 seconds, wow

krisdinesh
2020-10-13 01:05
Sorry...starting a new thread here Its new database nad doesnt have any data in it

bethskurrie
2020-10-13 01:05
like I said, you have other issues. you shouldn't need to set that.

bethskurrie
2020-10-13 01:05
Is there someone in your organisation with dev ops/database experience who can help you get set up?

bethskurrie
2020-10-13 01:06
We can't offer you step by step assistance deploying a free open source application.

krisdinesh
2020-10-13 01:06
ok...i am trying to resolve with our network team....I will see after that...thanks anyways for the prompt response

bethskurrie
2020-10-13 01:07
The instructions that are there should be sufficient for someone who is experienced with dev ops. But let us know if you get very stuck. Otherwise, you can get a free pactflow account instantly here https://pactflow.io

krisdinesh
2020-10-13 01:08
I am also inclined towards pact flow, but my client is on-premise :disappointed:

bethskurrie
2020-10-13 01:08
We do have an on-premise offering, which we can provide more support around.

krisdinesh
2020-10-13 01:11
Right now we are doing POC so setting up in local...but for on-premise, is there any pricing model available to view?

matt.fellows
2020-10-13 01:12
drop us a line to and I?ll get back to you with some

matt.fellows
2020-10-13 01:12
do you know roughly how big the team is that might use it?

krisdinesh
2020-10-13 01:13
sure, may be 10 users

ranjanayush03
2020-10-13 03:42
Yeah sure Beth ..

prabhakar.thippa
2020-10-13 04:58
has joined #pact-broker

giadinhluong
2020-10-13 06:24
has joined #pact-broker

pavank
2020-10-13 08:41
has joined #pact-broker

stephane.meng
2020-10-13 09:06
has joined #pact-broker

abirlal.bose
2020-10-13 09:45
has joined #pact-broker

sagupta
2020-10-13 14:39
Hi Folks, Just wanted to check is there a way to check when the webhook was triggered . I recently setup a webhook to trigger provider build when contract content changed but it triggered the provider build even when the pact was same as before and now i dont know how to debug this or fix it.

francisco.moreno
2020-10-13 15:52
Hello, There is some way to create two webhooks for one pact. I mean, I have two jenkins builds and I want one to be launched when the contracts change and another one when the provider publishes the results. Is it possible?


francisco.moreno
2020-10-13 16:17
I did it but at first I get an error. I don't know why

antonello
2020-10-13 16:18
An error when trying to create the webhook?

francisco.moreno
2020-10-13 16:20
yes

antonello
2020-10-13 16:20
What?s the error?

bethskurrie
2020-10-13 23:45
@sagupta it will probably be because a new tag was applied to existing content

bethskurrie
2020-10-13 23:45
Or you had some randomised data in there


bethskurrie
2020-10-13 23:46
> If the relevant consumer version has any tags, then for each tag, check if the content is different from the previous latest version for that tag. It is 'changed' if any of the checks are true. One side effect of this is that brand new tags will trigger a pact changed event, even if the content is the same as a previous version.

bethskurrie
2020-10-13 23:47
If you're using an OSS broker, you can look in the logs to see exactly why the webhook got triggered. Search by the consumer version number to find the logs for the publication, and soon after that you'll see logs about the webhook.

bethskurrie
2020-10-13 23:57
Also, there is a page with info on debugging webhooks in the docs here: https://docs.pact.io/pact_broker/webhooks/debugging_webhooks

saurabhapd
2020-10-14 06:18
Hi Guys, I have ran into an issue regarding contract upload to pact broker. So I have written around 10 fragments for a consumer provider interaction. All 10 belong to a single consumer. After generating the contract file it came up to around 114KB. Now when I am trying to do pact:publish to pact broker (with basic auth), its failing. I checked console log of broker and its the following (masked couple of details by xxxx). Now when I tried to do the same PUT request manually by postman, it worked from the same system/network. Can anyone help me why its happening?? Another thing to note: if I break the 114KB contract into smaller files with 10-20 KB each for each fragment, it works absolutely fine. Any help would be really appreciated. Thanks

matt.fellows
2020-10-14 09:20
Are you self hosting the broker?

matt.fellows
2020-10-14 09:20
Client terminated does indicate a client issue tho

mateusz.mrzyglod
2020-10-14 09:32
has joined #pact-broker

cathleen.yuan
2020-10-14 11:16
has joined #pact-broker

sagupta
2020-10-14 11:17
I have checked and indeed there was a new tag applied in consumer

sagupta
2020-10-14 11:21
One question but not related to the one in this thread: I am trying to setup the consumer pipeline as mentioned in https://docs.pact.io/pact_nirvana/step_4 . However i was wondering once consumer publishes pact to broker and then webhook is triggered , should we go to next job i.e. `can-i-deploy` ? I mean how to wait for the results from the provider build triggered from webhook?

mamtha.3687
2020-10-14 11:23
Anyone tried posting pact verification results to any other REST service without broker?

saurabhapd
2020-10-14 11:29
Yes. Its a self hosted broker in AWS. In client I am not doing anything out of the ordinary. Just using pact:publish plugin. Not sure where its going wrong

matt.fellows
2020-10-14 12:49
Not that I've heard. What's are you trying do?

matt.fellows
2020-10-14 12:50
Verbose logs might help identify the issue

matt.fellows
2020-10-14 12:50
Is there any proxy or anything you've added in front of the broker?

saurabhapd
2020-10-14 13:04
no. Nothing added. You mean spinning up pact broker in debug mode?

saurabhapd
2020-10-14 13:48
Did it in Debug mode. Nothing in the log

dorin.enache
2020-10-14 13:49
Hi :slightly_smiling_face:. I have a problem trying when publishing: [ERROR] Failed to execute goal au.com.dius.pact.provider:maven:4.1.0:publish (default-cli) on project transaction-api: Execution default-cli of goal au.com.dius.pact.provider:maven:4.1.0:publish failed: Plugin http://au.com.dius.pact.provi der:maven:4.1.0 or one of its dependencies could not be resolved: The following artifacts could not be resolved: io.github.microutils.kotlin-logging:kotlin-logging:jar:1.6.26, io.github.microutils.kotlin-logging:kotlin-logging-commo n:jar:1.6.26, io.github.microutils.kotlin-logging:kotlin-logging-js:jar:1.6.26: Failure to find io.github.microutils.kotlin-logging:kotlin-logging:jar:1.6.26 in https://repo.maven.apache.org/maven2 was cached in the local repository , resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

dorin.enache
2020-10-14 13:50
it seems that maven is unable to find this artifact(io.github.microutils.kotlin-logging:kotlin-logging-js:jar:1.6.26) in central repo. Do you have any idea from where to pick this?

phil.endsley
2020-10-14 14:00
Probably better to ask in #pact-jvm since this is specific to the maven plugin

saurabhapd
2020-10-14 15:09
Update: I finally used pact-broker-client binary to upload and its working now.

ramana.jaladurgam
2020-10-14 16:10
has joined #pact-broker

mamtha.3687
2020-10-14 17:56
Well, we have certain limitations to run the pact broker in the org so trying to post the results to the db through another service. Just trying to get my head around posting the verification results back for specific interactions.

alik.berezovsky
2020-10-14 18:38
has joined #pact-broker

a.robecke
2020-10-14 19:24
has joined #pact-broker

joel.whalen
2020-10-14 19:36
@bethskurrie Thanks for the docs link! I see the example in the `help` for `--consumer-version-selector` is using a single tag, ```{\"tag\":\"master\", \"latest\": true}``` how do I get it to work for a list of tags? Here?s what I?m doing in Python: ```def pact_consumer_tags(): consumer_version_selectors = [ { "tag": "master", "latest": True }, { "tag": "prod", "latest": True }, { "tag": "dev", "latest": True }, { "tag": "qa", "latest": True }, { "tag": "stg", "latest": True } ] consumer_version_selectors = json.dumps(consumer_version_selectors) return consumer_version_selectors``` The stringified JSON that gets passed to `--consumer-version-selector` looks like this: ```[{"tag": "master", "latest": true}, {"tag": "prod", "latest": true}, {"tag": "dev", "latest": true}, {"tag": "qa", "latest": true}, {"tag": "stg", "latest": true}]``` which is producing this error

joel.whalen
2020-10-14 19:36
```[pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] bundler: failed to load command: /pact/bin/pact (/pact/bin/pact) [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] TypeError: no implicit conversion of Symbol into Integer [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /usr/lib/ruby/gems/2.7.0/gems/pact-1.55.5/lib/pact/pact_broker/pact_selection_description.rb:9:in `block in pact_selection_description' [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /usr/lib/ruby/gems/2.7.0/gems/pact-1.55.5/lib/pact/pact_broker/pact_selection_description.rb:8:in `collect' [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /usr/lib/ruby/gems/2.7.0/gems/pact-1.55.5/lib/pact/pact_broker/pact_selection_description.rb:8:in `pact_selection_description' [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /usr/lib/ruby/gems/2.7.0/gems/pact-1.55.5/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb:92:in `log_message' [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /usr/lib/ruby/gems/2.7.0/gems/pact-1.55.5/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb:39:in `call' [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /usr/lib/ruby/gems/2.7.0/gems/pact-1.55.5/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb:34:in `call' [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /usr/lib/ruby/gems/2.7.0/gems/pact-1.55.5/lib/pact/pact_broker.rb:18:in `fetch_pact_uris_for_verification' [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /usr/lib/ruby/gems/2.7.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/aggregate_pact_configs.rb:45:in `pacts_for_verification' [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /usr/lib/ruby/gems/2.7.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/aggregate_pact_configs.rb:38:in `pacts_urls_from_broker' [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /usr/lib/ruby/gems/2.7.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/aggregate_pact_configs.rb:25:in `call' [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /usr/lib/ruby/gems/2.7.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/aggregate_pact_configs.rb:10:in `call' [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /usr/lib/ruby/gems/2.7.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/app.rb:199:in `all_pact_urls' [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /usr/lib/ruby/gems/2.7.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/app.rb:40:in `call' [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /usr/lib/ruby/gems/2.7.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/app.rb:34:in `call' [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /usr/lib/ruby/gems/2.7.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/cli/verify.rb:47:in `verify' [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /usr/lib/ruby/gems/2.7.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run' [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /usr/lib/ruby/gems/2.7.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command' [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /usr/lib/ruby/gems/2.7.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch' [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /usr/lib/ruby/gems/2.7.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start' [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /usr/lib/ruby/gems/2.7.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/cli/custom_thor.rb:17:in `start' [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /pact/lib/pact/cli.rb:53:in `verify' [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /usr/lib/ruby/gems/2.7.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run' [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /usr/lib/ruby/gems/2.7.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command' [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /usr/lib/ruby/gems/2.7.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch' [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /usr/lib/ruby/gems/2.7.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start' [pod/cart-service-verify-6a00e1cd-nhvtp/cart-service-verify] /pact/bin/pact:15:in `<top (required)>'```

joel.whalen
2020-10-14 19:36
Is this due to `json.dumps` failing to escape the quotations with `\`, or that I?m using a JSON list with `[]`? Or maybe both?

matt.fellows
2020-10-14 20:38
Are you not able to run the broker?

matt.fellows
2020-10-14 20:38
It sounds like you're going to try and build the can I deploy logic yourself?

sklein
2020-10-14 21:23
```def _get_consumer_version_selectors(self, settings): return [ json.dumps({"tag": tag.strip(), "latest": True }) for tag in settings.PACT_CONSUMER_VERSION_TAGS.split(",") ]```

sklein
2020-10-14 21:23
where PACT_CONSUMER_VERSION_TAGS is a comma separated string `prod,staging`

sklein
2020-10-14 21:23
that works for me

sklein
2020-10-14 21:24
you are serializing the array when you want to serialize each tag in the array and pass the array of serialized selectors

sklein
2020-10-14 21:26
albeit this is ruby and im speaking pythonese

sklein
2020-10-14 21:26
but i'd give that a try

mikahchapman
2020-10-14 21:47
has joined #pact-broker

joel.whalen
2020-10-14 23:17
I will give this a try tomorrow, that looks like it will work thanks so much

hem_kec
2020-10-15 00:44
has joined #pact-broker

mamtha.3687
2020-10-15 02:51
Nope, we use SQL server or Oracle database but broker doesn't support either. There's no provision to run it as a docker container in cloud (it's disabled for us). Moving the source code was also challenging because we lack Ruby expertise.

mamtha.3687
2020-10-15 02:52
Yes we are considering rewriting the can i deploy.

bethskurrie
2020-10-15 03:58
```--consumer-version-selector "{...}" --consumer-version-selector "{...}"```

bethskurrie
2020-10-15 03:59
@joel.whalen you need to specify one `--consumer-version-selector "{...}"` for each selector.

bethskurrie
2020-10-15 04:00
It's not a ruby thing as much as that's the way the CLI is designed.

matt.fellows
2020-10-15 08:00
Have you considered http://pactflow.io? Or is that off the cards because it?s a SaaS?

matt.fellows
2020-10-15 08:00
I cannot believe your company bans the use of Postgres!!!

sagupta
2020-10-15 08:45
@bethskurrie If you havent seen already

marco.cordeiro
2020-10-15 10:54
has joined #pact-broker

joel.whalen
2020-10-15 13:46
ah I see that throws a wrench in my automation script, but nothing I can?t get around. Thanks for clarifying

betty.he
2020-10-15 14:32
has joined #pact-broker

joel.whalen
2020-10-15 14:46
Hey it worked! Thanks all :slightly_smiling_face: ``` DEBUG: The pact at <my-pact-broker-url> is being verified because it matches the following configured selection criteria: latest pact for a consumer version tagged 'dev', latest pact for a consumer version tagged 'master', latest pact for a consumer version tagged 'prod', latest pact for a consumer version tagged 'qa', latest pact for a consumer version tagged 'stg' (all have the same content)```

rodrigocs
2020-10-15 16:19
has joined #pact-broker

mamtha.3687
2020-10-15 17:35
Well yea, sort of. And SaaS is also not an option right now. Any pointers at all to implement something on our own?

bethskurrie
2020-10-15 22:54
And look at that - you're only running one verification, not 5, like you would have with the old approach.

bethskurrie
2020-10-15 22:55
It's a biiiiig task.

bethskurrie
2020-10-15 22:56
I can show you the SQL, and it's complicated, and you need to add a bunch of logic on top of it to interpret the results.

bethskurrie
2020-10-15 22:57
@mamtha.3687 how are you exchanging the pacts in the first place?

matt.fellows
2020-10-15 23:21
@mamtha.3687 you?re on a path to re-building the pact broker. That effort would be better spent: 1. Working to convince people internally that running a postgres docker image is not so bad - and better yet, you won?t be giving more licensing dollars to Oracle! 2. Creating an Oracle DB adapter (I wouldn?t recommend it obviously, but maybe it?s doable :man-shrugging: )

matt.fellows
2020-10-15 23:22
Don?t forget that Pact and the Broker are constantly evolving, so any customisation you make you?ll need to continue to maintain

mamtha.3687
2020-10-16 01:08
@bethskurrie we are currently posting the pacts to another service that saves it in the database. For retrieval, we are trying to specify custom pact source and make a rest call in the custom class (still couldn't get it working).

mamtha.3687
2020-10-16 01:09
@bethskurrie the sql design can help a bit. I do get the intensity of the effort that will be needed here but there are a lot of customisations that we need over a period of time and this seemed like the only option we have.

mamtha.3687
2020-10-16 01:12
@matt.fellows it's just that the postgres or mysql database isn't having specific dbas to monitor and they're not ready to leave it unmonitored. I do get that concern about evolving pact and broker. But for now, the only focus is to get the basic verification happening at the bare minimum.

bethskurrie
2020-10-16 01:24
@mamtha.3687 There are workflows that you could use potentially use that don't rely on the broker/can-i-deploy as much.

bethskurrie
2020-10-16 01:25
The main reason that Oracle can't be supported is that some of the table names were too long, and I can't go back and change that without breaking the entire application for everybody.

bethskurrie
2020-10-16 01:25
It may be that more recent versions of the oracle db support longer names now?

bethskurrie
2020-10-16 01:27
So, if I was trying to build a contract workflow without a broker, I woulnd't try and re-write the broker or emulate that workflow. That's got 7 years of design and work in it.


bethskurrie
2020-10-16 01:27
Baking the provider verification step into the consumer's workflow.

bethskurrie
2020-10-16 01:28
That somewhat removes the need for can-i-deploy.

bethskurrie
2020-10-16 01:28
On the provider side, if you deploy as soon as possible after verification, then you have confidence that your verification results are still accurate for that environment.

bethskurrie
2020-10-16 01:29
> The need for this check increases proportionately with the time that elapses between your pact test execution and your release. If you practice continuous deployment, and you go straight from a test build into a production deployment build, then you can be pretty sure that the version of the other application that is in production probably hasn?t changed in the meantime. If there is a considerable amount of time, however, it is best to do a compatibility check again just before deploying. > For example, if you run a pact verification on Monday that verifies the recommended "master" and "production" pacts, but you don?t deploy the provider artifact until Friday, the version of the consumer that is now in production may have changed. > Alternatively, a pact may have been verified by the ?master? version of the provider, but that version of the provider may not yet have been deployed to production. The consumer cannot be deployed to production until the version of the provider that it depends on is in production (unless it has been specifically written to fail gracefully, which is actually the best approach, but is one that isn?t always followed).


tamer
2020-10-16 09:08
has joined #pact-broker

mario.gioiosa
2020-10-16 18:57
has joined #pact-broker

lior.baber
2020-10-19 07:33
has joined #pact-broker

jeffbdye
2020-10-19 17:10
has joined #pact-broker

jace
2020-10-19 19:22
has joined #pact-broker

almaak
2020-10-20 09:35
has joined #pact-broker

paolaagudelo10
2020-10-20 12:46
has joined #pact-broker

andra.moraru
2020-10-20 14:13
has joined #pact-broker

camila.coder91
2020-10-20 17:06
has joined #pact-broker

julzelements
2020-10-21 05:25
has joined #pact-broker

kapil.mathur
2020-10-21 06:40
has joined #pact-broker

mark.hudson
2020-10-21 10:45
has joined #pact-broker

cluu
2020-10-21 17:16
has joined #pact-broker

camila.campos
2020-10-21 21:35
has joined #pact-broker

longlevan
2020-10-22 09:15
has joined #pact-broker

justin.garfield
2020-10-22 16:15
has joined #pact-broker

guppy0356.nakira
2020-10-23 00:34
has joined #pact-broker

guppy0356.nakira
2020-10-23 07:03
I try to add webhook on local pact broker server. ```curl -X POST http://192.168.10.10/webhook -H "Accept: application/json" -H "Content-Type: application/json" -d@body.json``` body.json is like this. ```{ "provider": { "name": "Animal Service" }, "events": [{ "name": "contract_content_changed" }], "request": { "method": "POST", "url": "http://master.ci.my.domain:8085/rest/api/latest/queue/SOME-PROJECT?os_authType=basic", "headers": { "Accept": "application/json" } } }``` I have checked at `/webhook` but there is no new records. Why?

antonello
2020-10-23 07:19
Hi @guppy0356.nakira. Welcome to the Pact community! What response to you get from the broker when you make the call to create the webhook?

guppy0356.nakira
2020-10-23 07:24
Hi @antonello. I have got with `-v` option. ```Trying 192.168.10.10... TCP_NODELAY set Connected to 192.168.10.10 port 80 POST /webhook HTTP/1.1 Host: 192.168.10.10 User-Agent: curl/7.58.0 Accept: application/json Content-Type: application/json Content-Length: 357 * upload complete sent off: 357 out of 357 bytes HTTP/1.1 406 Not Acceptable Server: nginx/1.19.3 Date: Fri. 23 Oct 2020 07:20:10 GMT Content-Length: 0 Connection: keep-alive Vary: Accept X-Pact-Broker-Version: 2.67.0 X-Content-Type-Options: nosniff```

antonello
2020-10-23 07:26
You should be getting a 2xx response (201 I think), so your issue in the request somehow

guppy0356.nakira
2020-10-23 07:27
Are some problems in my JSON file?

antonello
2020-10-23 07:33
A 406 would suggest differently

antonello
2020-10-23 07:33
Can you try dropping the Accept header from your request?

antonello
2020-10-23 07:34
Btw, not sure if you know it, but you could use the pact broker client to create web hooks

guppy0356.nakira
2020-10-23 07:48
Okay. I have registered purpose records. Thanks :smile:

bethskurrie
2020-10-23 07:58
@guppy0356.nakira it's probably because the API returns `application/hal+json`

ercalbwar
2020-10-24 19:24
has joined #pact-broker

andrewshtamburg
2020-10-25 13:04
has joined #pact-broker

siad.ardroumli
2020-10-25 18:16
has joined #pact-broker

joaquin
2020-10-25 18:48
Hey! I'm setting up the CI with pact-cli and i came across this "problem" in the *verify* step. Since there are no consumer versión with the given tag the verify step does nothing and exists normally, but i would expect for it to exit with an invalid status so i can stop the CI job. *command:* `docker run --rm --net host -e PACT_BROKER_BASE_URL=http://localhost:9292 -e PACT_BROKER_USERNAME=readwrite -e PACT_BROKER_PASSWORD=readwrite -e PACT_BROKER_PUBLISH_VERIFICATION_RESULTS=true pactfoundation/pact-cli:0.17.2.0 verify --provider ms-provider-name --provider-base-url http://localhost:8080 --provider-app-version v0.1.3-202010251400 --provider-version-tag dev --consumer-version-tag dev --enable-pending --wait 10` *output:* > INFO: Polling for up to 10 seconds for provider to become available at localhost:8080... > INFO: Provider available, proceeding with verifications > INFO: Fetching pacts for ms-provider-name from http://localhost:9292 for tags: latest desa *exit status:* 0 (zero) Does anyone know if this is an expected behavior?

bethskurrie
2020-10-25 23:12
Different people expect different things @joaquin!

bethskurrie
2020-10-25 23:12
I've just had someone asking for the opposite thing to happen in another tool :laughing:

bethskurrie
2020-10-25 23:13
You can raise a feature request to make it configurable to raise an error if there are no pacts in http://pact.canny.io

joaquin
2020-10-25 23:38
If i understand things correctly, this behavior would mean that a provider build would just run until the first consumer publishes some pacts, right? which if you are coming from provider-first workflow (like myself) i guess is not so bad

joaquin
2020-10-25 23:38
(thanks for the answer btw)

bethskurrie
2020-10-25 23:39
Yes, it would just pass fine until it got the first contract. I think JVM is the other way around, and it fails if there are no contracts unless you configure it not to.

bethskurrie
2020-10-25 23:39
The joys of implementing a framework in 10+ languages!

joaquin
2020-10-25 23:46
I bet :smile: . I'll see to that feature request, and who knows maybe i'll send the PR my self...

bethskurrie
2020-10-25 23:46
:party_parrot:

bethskurrie
2020-10-25 23:47
Should be a pretty quick and easy addition.

joaquin
2020-10-25 23:49
Now you're teasing me :slightly_smiling_face:

bethskurrie
2020-10-25 23:49
It's hacktoberfest! Get in quick!

srikanthpmailid
2020-10-26 01:02
has joined #pact-broker

photesthesis_geospiza
2020-10-26 15:10
has joined #pact-broker

ercalbwar
2020-10-26 20:23
Hi everyone! I have a couple of questions about Pact Broker and I was hoping you could help me out :slightly_smiling_face: *Question 1* I am currently debugging some issues with my Webhooks (following https://docs.pact.io/pact_broker/webhooks/debugging_webhooks) and I was wondering if there is a way to delete webhooks through the pact broker website. I also found a row on the database that I could delete but, since I am pretty new with Pact, I didn't break things even more than they are now. *Question 2* ~I'm trying to use the *broker create-or-update-webhook* command but it keeps complaining if I try to use two body parameters (for example: -d token=bla -d branch=main).~ ~Is there a way to use multiple form parameters with this command or is it not supported?~ I had to use & to append both parameters. -d "token=something&branch=something" Cheers

bethskurrie
2020-10-26 20:42
@ercalbwar there is no UI for webhooks in the OSS Pact Broker. To delete a webhook, you send a DELETE request to it's URL.


bethskurrie
2020-10-26 20:42
There is a UI for managing webhooks in http://pactflow.io (a commercial offering of the Pact Broker)

ercalbwar
2020-10-26 20:56
What would the webhook URL be in this case?

bethskurrie
2020-10-26 21:27
Have you been using the HAL browser?

bethskurrie
2020-10-26 21:28
Here are instructions for opening the webhook resource in the HAL browser https://docs.pact.io/pact_broker/webhooks/debugging_webhooks#pact-broker

bethskurrie
2020-10-26 21:28
Click on the `NON-GET` button for the `self` relation, change the request method to `DELETE` and then click `Make Request`

bethskurrie
2020-10-27 07:57
Hey broker users. The OSS docker image comes with a read only user and a read/write user. The intent is that CI gets the read/write user and the devs/testers get the read only user. Once the "testing it out" evaluation/spike period is over, who uses it as described, and who allows the devs/testers access to the write credentials?

ercalbwar
2020-10-27 10:38
My first observation (still in the "testing it out" phase though) is that it would be great to scope write access to specific pacts that a given (consumer?) team owns.

ercalbwar
2020-10-27 13:20
Hi again and _*apologies for my spam over the last couple of days*_ :pray:, going through the "spike" phase right now and uncovering some issues as I go. > *This question is about the webhook integration with Jenkins.*

ercalbwar
2020-10-27 13:20
The first thing that I wanted to call out is that I was surprised to find that there are no instructions for Jenkins in the https://docs.pact.io/pact_broker/webhooks/template_library, maybe this is an opportunity for me to send my first PR once I get it to work :) In Jenkins, you can trigger builds remotely via what they call the https://www.jenkins.io/doc/book/using/remote-access-api/. TL;DR, you just need to send a curl command. According to the https://github.com/pact-foundation/pact_broker-client/#create-webhook, this integration should be as simple as preparing the curl command and adding a couple of things. Unfortunately, that didn't work for me. Here is an example of the curl command that successfully triggers the job when I run it from my laptop (I have omitted those parts that are a bit sensitive): `curl -vX POST "https://user:<secret>@dockerjenkins.riotgames.com/job/<path_to_job>/build" -d token=token` And here is the command I am using to create the webhook: `docker run --rm pactfoundation/pact-cli:latest broker create-or-update-webhook https://user:<secret>@dockerjenkins.riotgames.com/job/<path_to_job>/build --uuid=696c5f93-1b7f-44bc-8d03-59440fcaa9a0 -X POST -b <broker_URL> -d token=token --contract-published` The command finishes successfully but, when I trigger the webhook execution by publishing a new contract, I can see some errors in the broker logs: `[2020-10-27T11:29:19Z] DEBUG: Webhook context {"base_url":"<broker_url>","consumer_version_tags":["pact-test"],"event_name":"contract_published"}` `[2020-10-27T11:29:19Z] INFO: HTTP/1.1 POST https://user:<secret>@dockerjenkins.riotgames.com/job/<path_to_job>/build` `[2020-10-27T11:29:19Z] INFO: accept: */*` `[2020-10-27T11:29:19Z] INFO: host: http://dockerjenkins.riotgames.com` `[2020-10-27T11:29:19Z] INFO: content-length: 19` `[2020-10-27T11:29:19Z] INFO: content-type: application/x-www-form-urlencoded` `[2020-10-27T11:29:19Z] INFO: token=token` `[2020-10-27T11:29:19Z] INFO: HTTP/1.1 403 Forbidden` `[2020-10-27T11:29:19Z] INFO: server: nginx/1.14.0` `[2020-10-27T11:29:19Z] INFO: date: Tue, 27 Oct 2020 11:29:19 GMT` `[2020-10-27T11:29:19Z] INFO: content-type: text/html;charset=utf-8` `[2020-10-27T11:29:19Z] INFO: content-length: 711` `[2020-10-27T11:29:19Z] INFO: connection: keep-alive` `[2020-10-27T11:29:19Z] INFO: vary: Accept-Encoding` `[2020-10-27T11:29:19Z] INFO: x-content-type-options: nosniff` `[2020-10-27T11:29:19Z] INFO: set-cookie: JSESSIONID.6f8fc1a0=node017z9zybpfza0g1nfrskob4sun65848.node0; Path=/; Secure; HttpOnly` `[2020-10-27T11:29:19Z] INFO: expires: Thu, 01 Jan 1970 00:00:00 GMT` `[2020-10-27T11:29:19Z] INFO: x-hudson: 1.395` `[2020-10-27T11:29:19Z] INFO: x-jenkins: 2.222.3` `[2020-10-27T11:29:19Z] INFO: x-jenkins-session: 837369b0` `[2020-10-27T11:29:19Z] INFO: x-hudson-cli-port: 50000` `[2020-10-27T11:29:19Z] INFO: x-jenkins-cli-port: 50000` `[2020-10-27T11:29:19Z] INFO: x-jenkins-cli2-port: 50000` `[2020-10-27T11:29:19Z] INFO: <html><head><meta http-equiv='refresh' content='1;url=/login?from=%2Fjob%2F<path_to_job>%2Fbuild'/><script>window.location.replace('/login?from=%2Fjob%2F<path_to_job>%2Fbuild');</script></head><body style='background-color:white; color:white;'>` `Authentication required` `<!--` `-->` `</body></html>` `[2020-10-27T11:29:19Z] INFO: Retrying webhook in 10 seconds` I have tried multiple combinations of the webhook command creation but I can't get it to work. Has anyone seen this before or can you spot something that I am missing? My gut-feeling tells me that it has to do with the way form parameters are passed (-d) but that could be a red herring. Last comment, I found about the https://github.com/pact-foundation/pact-broker-docker#webhook-whitelists yesterday but that didn't help. Cheers

antonello
2020-10-27 13:33
It looks like Jenkins is telling you that the authentication is failing

antonello
2020-10-27 13:35
Are you actually providing valid credentials for the Jenkins request? I can see `user:<secret>` in your logs. Is that just you redacting those to paste it here?

antonello
2020-10-27 13:37
My suggestion would be to test your Jenkins API requests separately before trying to create a broker webhook.

antonello
2020-10-27 14:06
Ignore my second message - I saw that you omitted the sensitive parts, which I imagine included those credentials.

ercalbwar
2020-10-27 14:06
I redacted those prior to pasting them here. They work when used via curl, but they don't work in the webhook

antonello
2020-10-27 14:07
but, in other words, does the following work? ```curl -vX POST "https://user:<secret>@dockerjenkins.riotgames.com/job/<path_to_job>/build" -d token=token```

ercalbwar
2020-10-27 14:07
Yup

ercalbwar
2020-10-27 15:12
That icon represents that the build was started from a remote host

antonello
2020-10-27 16:04
What?s the reason for using both Basic auth and a token?

ercalbwar
2020-10-27 16:16
I believe that's required by Jenkins. You can see some examples here: https://serverfault.com/questions/888176/how-to-trigger-jenkins-job-via-curl-command-remotely

ercalbwar
2020-10-27 16:17
I don't have much context on why it was implemented that way though :confused:

antonello
2020-10-27 16:34
Could you try if this works please? `curl -vX POST "https://dockerjenkins.riotgames.com/job/<path_to_job>/build" -L --user <username>:<password>`

ercalbwar
2020-10-27 16:58
That did it! :bananadance: :man_dancing: :dancer: :dancers:

ercalbwar
2020-10-27 16:58
For some reason, it didn't like when I was embedding the credentials in the URL. Once I moved them to the -u parameter, it all worked (including the webhook)

ercalbwar
2020-10-27 16:59
Thanks for the suggestion @antonello!

antonello
2020-10-27 17:01
De nada, Alberto!

jackbwheatley
2020-10-27 21:02
has joined #pact-broker

matt.fellows
2020-10-27 21:46
awesome debugging @antonello! :taco:

carlosalmeida.xon
2020-10-27 22:06
has joined #pact-broker

abubics
2020-10-28 00:54
I definitely use it as intended, although I don't get to spin up new brokers & pipelines so often recently :cry:

tjones
2020-10-28 05:34
Don't worry about asking too many questions - questions are what this channel is for :+1:

tjones
2020-10-28 05:34
(well, really this whole slack)

nasir.amin
2020-10-28 11:07
has joined #pact-broker

jimish.shah.-nd
2020-10-28 11:26
has joined #pact-broker

simon.nizov
2020-10-28 12:39
Hi all, ? I?m running the latest version of both the broker and `pact-provider-verifier`, ? I?m using both of the flags: `--enable-pending` and `--include-wip-pacts-since="2020-10-27"` ? I have `--consumer-version-selector="{\"tag\": \"dev\", \"latest\": true}"` ? I see the appropriate log: ```INFO: Fetching pacts for Foo from https://.... with the selection criteria: latest for tag dev, work in progress pacts created after 2020-10-27``` But in no point during verification do I see this log for the correct pact version: ```DEBUG: The pact at https://.../pact-version/XXX is being verified because it matches the following configured...``` How can I debug why my newly published and unverified pact isn?t being verified using the new WIP pacts feature?

simon.nizov
2020-10-28 13:17
Removing the `consumer-version-selector` fixed it and now only my new pact version is being verified. Are `--consumer-version-selector` and `--include-wip-pacts-since` not supposed to work together?

phil.endsley
2020-10-28 13:25
They can (and should imo) be used together. Are you specifying provider tags in your command?

adam_figgins
2020-10-28 14:20
has joined #pact-broker

simon.nizov
2020-10-28 14:21
@phil.endsley Nope, here?s my command: ```./pact-provider-verifier \ --provider-base-url=http://localhost:8000/v1 \ --provider-states-setup-url=http://localhost:8000/setup_provider_states/ \ --pact-broker-base-url=... \ --broker-username=... \ --broker-password=... \ --consumer-version-selector="{\"tag\": \"dev\", \"latest\": true}" \ --provider="..." \ --custom-provider-header="Authorization: ..." \ --enable-pending \ --include-wip-pacts-since="2020-10-25"```

phil.endsley
2020-10-28 14:31
Hmm...I don't use `pact-provider-verifier` myself, and I don't see it mentioning what parameters to use in the docs. Maybe try this one? > [--provider-version-tag=TAG] > # Tag to apply to the provider application version. May be specified multiple times. Where TAG would be an existing tag for the provider version you're running verification on. Pending and WIP pacts are relative to a provider tag (ex: A given pact may be pending for a provider's `develop` tag, but not `feat-x`) and are determined dynamically when the call to Pact Broker is made. In order to determine which ones are actually pending/wip, you must provide that tag to the broker. I'm not sure how this would work if there's no option to provide that tag

phil.endsley
2020-10-28 14:32
If that param doesn't work, you might just have to wait for @bethskurrie to come online

phil.endsley
2020-10-28 14:35
I think all client implementations have a parameter used to specify this (ex: JVM uses `pactbroker.providerTags` sys property https://docs.pact.io/implementation_guides/jvm/provider/junit/#work-in-progress-wip-pact-support-version-415-and-later), just don't see one mentioned in the readme for `pact-provider-verifier`

simon.nizov
2020-10-28 14:49
That worked! `provider-version-tag` is in the readme: https://github.com/pact-foundation/pact-provider-verifier

simon.nizov
2020-10-28 14:49
Thanks @phil.endsley!

phil.endsley
2020-10-28 14:51
Yeah, saw it in the readme, but every reference to it is for tagging when publishing. Maybe just needs an update

simon.nizov
2020-10-28 14:52
Ah got it

antonello
2020-10-28 15:04
:taco: for @phil.endsley! :slightly_smiling_face:

aperdomobo
2020-10-28 15:42
has joined #pact-broker

diazguerra2
2020-10-28 16:06
has joined #pact-broker

xsamore
2020-10-28 19:52
has joined #pact-broker

simon
2020-10-28 20:49
has joined #pact-broker

matt.fellows
2020-10-28 22:55
> The first thing that I wanted to call out is that I was surprised to find that there are no instructions for Jenkins in the https://docs.pact.io/pact_broker/webhooks/template_library, maybe this is an opportunity for me to send my first PR once I get it to work :) We know people use Pact with Jenkins, however it tends to get used in Enterprises and for whatever reason, they rarely contribute back. Most of the maintainers haven?t used Jenkins for a long time, hence why we haven?t added it. @xandebianchi would you be willing to share the actual webhook request configured in your Pact Broker to as a PR to https://github.com/pact-foundation/docs.pact.io/blob/master/website/docs/pact_broker/webhooks/template_library.md ?

ruben.cagnie
2020-10-29 01:24
has joined #pact-broker

272939217
2020-10-29 05:33
has joined #pact-broker

driloni92
2020-10-29 09:05
has joined #pact-broker

pauloavra
2020-10-29 12:33
has joined #pact-broker

bethskurrie
2020-10-29 21:39
@ercalbwar We're in the process of adding team based permissions to Pactflow. These won't be in the OSS Pact Broker though.

bethskurrie
2020-10-29 21:43
Another :taco: for @phil.endsley


bethskurrie
2020-10-29 21:44
It's quite complicated to make it do what you'd expect intuitively. I'll update it to make it very clear that the provider version tag is required.

matt.fellows
2020-10-29 21:52
:point_up: for the taco givers, I think the taco needs to go _after_ the name, otherwise no cred is transferred

bethskurrie
2020-10-29 21:53
That's annoying.

phil.endsley
2020-10-29 21:53
The one Beth gave worked

matt.fellows
2020-10-29 21:53
ok, ignore me

matt.fellows
2020-10-29 21:54
homer bush

matt.fellows
2020-10-29 21:54
(I recall taco telling me off once, :man-shrugging: )

antonello
2020-10-29 22:30
They must have improved the recipe!

wilkinsweiqiangliang
2020-10-30 07:27
has joined #pact-broker

simon.nizov
2020-10-30 13:52
Was there ever any talk about having a statistics page in the broker? :bar_chart: It can be really useful to be able to show teams a dashboard with aggregated information about their pact usage. For example - ?Here are all the times we would introduce bugs into production in the last 6 months if it weren?t for pact? or ?Here are the pacts that are pending for providers to implement a change?, etc..

joel.whalen
2020-10-30 13:57
Should make that a #feature-requests if it isn?t one already

simon.nizov
2020-10-30 15:20
Good idea!

simon.nizov
2020-10-30 15:25
Couldn?t find a similar feature request so I created one: https://pact.canny.io/feature-requests/p/statistics-dashboard

jikogay728
2020-10-30 17:20
has joined #pact-broker

matt.fellows
2020-10-30 21:05
Yes there has been. But thanks for raising!

blmlcu
2020-10-31 14:51
has joined #pact-broker

reemadhiman92
2020-11-02 16:26
has joined #pact-broker

jamescourtoy
2020-11-02 21:04
has joined #pact-broker

telmo.ferreira.costa
2020-11-03 11:32
has joined #pact-broker

sergii.kopovskyi
2020-11-03 12:35
has joined #pact-broker

aliaksandr.valadzko
2020-11-03 13:15
Hello guys! I'm a bit confused about CI pipeline set up I have a question regarding: `Publish pact -> Webhook -> Publish result -> Can I Deploy` flow, from this image:


aliaksandr.valadzko
2020-11-03 13:24
So, assume I have consumer version `v123`, which generates pact `v123` There are 2 options here: 1. pact `v123` is the same as pact `v122` 2. pact `v123` is different from pact `v122` And in 1 option - no new job run will be triggered (I can rely on previous Provider pact verification results) in 2 option - webhook will trigger pact verification (I need to wait for new Provider pact verification results be published) My question is, how can I differentiate these cases it from Consumer CI pipeline? How can I understand, that new pact verification job was triggered and I need to wait before Provider verification results be published to broker? Thanks in advance

aliaksandr.valadzko
2020-11-03 13:29
So, assuming Provider CI is black box for me, is there a chance to understand should I wait for new results before `CanIDeploy` step?

antonello
2020-11-03 13:30
Hi @aliaksandr.valadzko a couple of ideas: ? call can-i-deploy on the consumer pipeline, which will tell you whether there was something to verify or not ? Call the diff end-point the the broker offers to see if the pact changed ? Poll the corresponding provider pipeline / job

aliaksandr.valadzko
2020-11-03 14:39
Hey Anto, thanks for responding If pact was changed, I receive such a message after CanIDeploy: ```There is no verified pact between the latest version of its_consumer (v123) and version 1.0.0.branch.v456 of fr_provider``` These I get on Consumer side So I need to introduce some kind of script in Consumer job, that will overwrite CanIDeploy task, and if it will get such a message ^, it will wait until triggered by webhook job will publish Pact verification result? Sounds pretty complicated, isn't it? Also, how can I poll Pact Broker to understand if new result was published?

aliaksandr.valadzko
2020-11-03 14:51
Also, sound like should be popular question:slightly_smiling_face:

aliaksandr.valadzko
2020-11-03 17:10
Guys, any advices?) Thanks in advance

irldev
2020-11-03 17:56
has joined #pact-broker

irldev
2020-11-03 17:57
Hello, this might be a silly question but can the pact broker be setup in the cloud, some place like AWS or Azure?

silverton.gimenes
2020-11-03 17:58
has joined #pact-broker

aliaksandr.valadzko
2020-11-03 18:01
We deploy it to AWS ec2 (service and database separately)

colber16
2020-11-03 18:34
has joined #pact-broker

cvoong
2020-11-03 18:55
has joined #pact-broker

matt.fellows
2020-11-03 21:16
Yep it sure can. Pactflow runs on AWS too :wink:

matt.fellows
2020-11-03 21:16
If you can run docker it's the easiest path to running on a cloud environment

bethskurrie
2020-11-04 00:47
Ok, so the answer is, you shouldn't need to know.

bethskurrie
2020-11-04 00:47
All changes to the pact should be done on a branch, not master.

bethskurrie
2020-11-04 00:48
So, by the time the pact feature branch is merged into master, it should already be pre-verified, and should pass - no waiting around.

bethskurrie
2020-11-04 00:49
If you want to wait around for the verification results, you can use the `--retry-while-unknown` feature of the `can-i-deploy` tool documented here: https://docs.pact.io/pact_broker/client_cli/readme#can-i-deploy

bethskurrie
2020-11-04 00:50
@aliaksandr.valadzko @abubics @antonello ^^

bethskurrie
2020-11-04 00:55
The sequence of events for adding a new feature could be something like: ? branch consumer ? add/change interaction ? push change to branch ? can-i-deploy fails (correctly) ? build stops ? provider implements change ? <notify consumer of passing pact, either by words or webhook> ? consumer team kicks off branch build again ? can-i-deploy passes ? merge in consumer branch to master

aliaksandr.valadzko
2020-11-04 08:03
Thanks a lot @bethskurrie :pray: `--retry-while-unknown` sounds like what I looked for! I totally agree of provided flow ^ However, I assume, there are some situations, when contract changes on Consumer side could possibly be fulfilled without changes in Provider side (for example adding some fields, to contract, that Provider already returns in response) And to remove manual step of failed Consumer job rerun, we can wait until Provider job (triggered by webhook due to contract change) will end One follow up question here: Is this `--retry-while-unknown` feature available only in *CLI*, or it should also work in gradle *PactCanIDeployTask* ? Thanks again!

ashish_garg5
2020-11-04 09:34
Hi All, How do i run my provider against all consumer tags present in the pact broker ? I have consumer with 2 tags in broker and my provider is running against the latest one only and not the both. How i can make it to run and verify against all tags of consumer. Thanks in advance.

irldev
2020-11-04 10:24
Ah ok thanks. Does the DB have to be in the docker container too?

matt.fellows
2020-11-04 10:38
Of course not, its just a standard stateless style application with a database. Pop it in a load balancing group behind a load balancer and you're up and running

jarmy
2020-11-04 23:22
Hello. I?ve got a question about the usage of this https://docs.pact.io/pact_broker/advanced_topics/api_docs/webhooks/#event-types > `contract_content_changed:` triggered when the content of the contract, or tags applied to the contract have changed since the previous publication. I have set up a webhook that triggers a Jenkins job which runs a provider verification test whenever the consumer generates the above event. The consumer publishes the pact with the following options: ```const gitSha = exec('git rev-parse --short HEAD'); const branch = process.env.BRANCH_NAME || exec('git rev-parse --abbrev-ref HEAD'); const opts = { pactFilesOrDirs: [path.resolve(process.cwd(), 'contract/pacts')], pactBroker: 'https://pact-broker.docker.savagebeast.com/', consumerVersion: gitSha, tags: [branch], };``` The provider then uses a https://docs.pact.io/pact_broker/advanced_topics/consumer_version_selectors/ to verify pacts tagged with the `master` branch. Since the pact can be tagged with multiple branch names, it results in the provider verification job getting triggered _without_ the verification tests always running because of the selectors. This can create a queue of CI jobs, which is something I?d like to avoid. Do we really want to trigger this event when a new tag is created yet the content hasn?t? What?s the preferred strategy for using `contract_content_changed` webhooks with version selectors?

matt.fellows
2020-11-04 23:29
The recommended approach is trigger a build of a provider verification specific job that _only_ looks at the pact URL that was changed

matt.fellows
2020-11-04 23:29
rather than using the selectors as per a standard provider build



jarmy
2020-11-04 23:41
We want to pass the PACT_URL into the CI job like this then modify the test to conditionally use it? ``` "config": { "env": { "global": [ "PACT_URL=${pactbroker.pactUrl}" ] } }```

matt.fellows
2020-11-04 23:42
yes something like that

matt.fellows
2020-11-04 23:43
In advanced setups, we trigger a separate provider job that just does the pact verification (sorry this is the better summary URL for that: https://docs.pact.io/pact_nirvana/step_4#e-configure-pact-to-be-verified-when-contract-changes)

jarmy
2020-11-04 23:50
Ok. This makes much more sense. Now, I?ve just got to figure out how to implement this in our existing J20 infrastructure..

matt.fellows
2020-11-04 23:51
Alternatively, if you can have a toggle on your normal build to ?skip steps? if that env var is present, that would work too

marzieh312
2020-11-05 00:55
has joined #pact-broker

bethskurrie
2020-11-05 05:02
That's an unusual usecase @ashish_garg5. Can you explain further?

bethskurrie
2020-11-05 05:02
This will kind of help https://docs.pact.io/wip

ashish_garg5
2020-11-05 05:04
i am able to do this by using @PactBroker(host="pactbroker", port = "80", tags = {"latest", "dev", "prod"})

ashish_garg5
2020-11-05 05:05
so in this tags now i have defined all the tags against which my provider will run

ashish_garg5
2020-11-05 05:05
by default it was doing verification against latest tag only

bethskurrie
2020-11-05 05:06
Indeed. So have you worked out how to do what you want?

ashish_garg5
2020-11-05 05:06
yes

bethskurrie
2020-11-05 05:07
:thumbsup::skin-tone-3:

bethskurrie
2020-11-05 05:13
It's only available in the CLI @aliaksandr.valadzko

bethskurrie
2020-11-05 05:14
You could raise a feature request or a PR if you're interested in using in the the maven task

bethskurrie
2020-11-05 05:14
Ron's pretty busy at the moment, so if you're keen on it, you could submit a PR.

aliaksandr.valadzko
2020-11-05 05:14
Thanks a lot!

reema.dhiman
2020-11-05 13:08
has joined #pact-broker

pbobba
2020-11-09 23:03
has joined #pact-broker

jun.li
2020-11-09 23:05
has joined #pact-broker

jun.li
2020-11-09 23:19
HI, I got this problem ```The name "aaaaaaaaa bbbb Provider" is very similar to the following existing consumers/providers: * aaaaaaaaa ccc Provider If you meant to specify one of the above names, please correct the pact configuration, and re-publish the pact. If the pact is intended to be for a new consumer or provider, please manually create "Required Action Condition API Event Provider" using the following command, and then re-publish the pact:``` Is there any configuration I can do to avoid manually publish?



matt.fellows
2020-11-09 23:21
`use_case_sensitive_resource_names`

matt.fellows
2020-11-09 23:21
:point_up: also this

bethskurrie
2020-11-09 23:22
Are those the literal values that you're using for the names?

bethskurrie
2020-11-09 23:22
I dont' recommend turning off the duplicate checking. It seems like you're just doing a spike though, and the best way to get around it would be to create the pacticipant manually.

bethskurrie
2020-11-09 23:22
If you turn off the duplicate checking you're likely to end up with corrupted data.

bethskurrie
2020-11-09 23:23
Also, it's best not to put the word "provider" in there if you can avoid it. Provider is a role an app takes, not an identitiy in itself. Who knows if that provider will one day consume another service and become a consumer as well?

jun.li
2020-11-09 23:32
thanks

douweicai
2020-11-10 04:11
has joined #pact-broker

christian.huber
2020-11-10 09:20
has joined #pact-broker

vuttithatkrongyot
2020-11-10 10:57
has joined #pact-broker

mateusz.derks
2020-11-10 15:01
Hey, is there any prerequisites for this feature to be effective? https://github.com/pact-foundation/pact_broker/blob/master/CHANGELOG.md#v2670-2020-10-16 > if a pact was successfully verified because it was included as a WIP pact, keep it as WIP I run pact-broker 2.67.0 and my consumer branches are considered WIP only until the verification pass. I?m querying `/pacts/provider/PROVIDER/for-verification` with ``` { "consumerVersionSelectors": [{"consumer": "CONSUMER", "tag": "production", "latest": true}], "includeWipPactsSince": "2020-11-09", "includePendingStatus": true, "providerVersionTags": ["master"] }```

mateusz.derks
2020-11-10 15:23
We have `production` and `master` tags for the consumer. We have `production` and `master` for the provider. We have 2 branches with a new feature: `feat-1` provider and `feat-1` consumer. Before the provider `feat-1` is merged, `feat-1` is returned as WIP. The `master` provider verification of pact related to `feat-1` is red. When the provider `feat-1` is merged, the `feat-1` consumer contract is satisfied and such branch is no longer WIP for the next provider runs.

dan.iosif
2020-11-10 17:06
has joined #pact-broker

yann.courtel
2020-11-11 08:57
I echoed Beth for the duplicate. I had a similar issue but rejected changing the config as the intended purpose for creating a 'similar' PACT was for a demo therefore not a good functional name. As far as adding consumer or provider in the name, absolutely not a good idea. It will be a nightmare to troubleshoot your pacts afterwards. Actually don't add any technical details to it. In our organisation where we have close to 600 pacts we just append the namespace with the functional name. No API, Messaging, Rabbit, Consumer, Provider, etc in the name. Good luck

matt.fellows
2020-11-11 09:16
600 pacts! Would love to hear more about this!

matt.fellows
2020-11-11 09:17
Would you be up for a chat with a few of us maintainers?

bethskurrie
2020-11-11 09:17
@mateusz.derks if you have that version of the broker, then the pacts should stay WIP until the contents have been explicitly included.


bethskurrie
2020-11-11 09:18
That reminds me, that change to WIP needs to be documented. Thanks.

bethskurrie
2020-11-11 09:21
I'm just reading your description, and I don't understand what the difference is between the actual be behaviour and the desired behaviour.

yann.courtel
2020-11-11 10:13
Hi Matt, of course. We have a pending email conversation :slightly_smiling_face: Thank you.

matt.fellows
2020-11-11 10:17
:slightly_smiling_face:

greg719
2020-11-11 10:40
hey guys, i am making a presentation about efficient testing strategy on NG Poland (biggest angular conference in Central Europe) - of course pact is part of the presentation. However I am trying to show case pact broker (using our own broker setup). But when I wanna show that you can use stub responses from the broker, it throws me 401 so my question is: can I make it public in the broker? any chance to get a broker just for the conference? or should i go with auth?

matt.fellows
2020-11-11 10:47
Cool!

greg719
2020-11-11 10:47
not sure how can i even authenticate from the client :slightly_smiling_face:

matt.fellows
2020-11-11 10:47
Are you referring to the stub feature in Pactflow? Or the pact-stub-server using Pact Broker as a contract source?

greg719
2020-11-11 10:47
so i published my pact

greg719
2020-11-11 10:48
now i would like to showcase that you do not need mocks / stubs because pact already does it for you

greg719
2020-11-11 10:48
so i went to the pact broker panel and copied stub url

greg719
2020-11-11 10:48
but i get 401 in my angular app

matt.fellows
2020-11-11 10:48
gotcha, so you?re using Pactflow

greg719
2020-11-11 10:48
yeps

matt.fellows
2020-11-11 10:49
Because we don?t want your pacts to be visible to the world, we opted for authentication on the stub URLs. Perhaps we can make this configurable, so that this constraint disappears

matt.fellows
2020-11-11 10:50
If you supply a standard bearer header with a pactflow API token e.g. `Authorization: Bearer <read-only API token>` it should work cc: @bethskurrie @uglyog We may need to have a separate header for this use case, because it?s possible it may conflict with existing stubs that need an Authorization header :slightly_smiling_face:

mateusz.derks
2020-11-11 10:52
Hey @bethskurrie I select production tag of the consumer in the master provider verification. I wanted to keep branches of consumer WIP as long as they are ahead of production consumer. What I see is that once any WIP consumer branch is verified successfully they are no longer selected by WIP selector. I saw the test and it looks like this case indeed hence I was wondering what I am missing.

mateusz.derks
2020-11-11 10:56
If you think it should work I can try to reproduce it in an isolated environment.

matt.fellows
2020-11-11 10:56
I have to run Greg, because it?s late here. If you need a test account for the demo, drop us a line (you know how to find me) and we?ll get you up and running.

greg719
2020-11-11 10:57
this should do for the presentation, but yes would be a nice feature if we could attach extra (broker-only) header

greg719
2020-11-11 10:57
but actually i could do an interceptor that checks if a base url contains pact flow or not, then do it automatically

greg719
2020-11-11 10:57
sure no problem :slightly_smiling_face:

matt.fellows
2020-11-11 10:58
Awesome, let us know how you go - feedback on the stubs is helpful for us to evolve it. So don?t be afraid!

greg719
2020-11-11 10:58
so have a nice evening :slightly_smiling_face:

brendan.donegan
2020-11-11 11:13
has joined #pact-broker

brendan.donegan
2020-11-11 11:14
Hi, I am having trouble adding a webhook to publish the verification status to GHE from our Pact broker (version 2.59.2) - the error we get is:

brendan.donegan
2020-11-11 11:14
```{ "error": { "message": "undefined local variable or method `decoractor_options' for #<PactBroker::Api::Resources::PactWebhooks:0x00007f3afd1df3f0>", "reference": "QJKJcflszL", "backtrace": ["/pact_broker/vendor/bundle/ruby/2.6.0/gems/pact_broker-2.59.2/lib/pact_broker/api/resources/pact_webhooks.rb:55:in `from_json'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/webmachine-1.5.0/lib/webmachine/decision/helpers.rb:65:in `accept_helper'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/webmachine-1.5.0/lib/webmachine/decision/flow.rb:424:in `n11'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/webmachine-1.5.0/lib/webmachine/decision/fsm.rb:31:in `block (2 levels) in run'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/webmachine-1.5.0/lib/webmachine/decision/fsm.rb:51:in `handle_exceptions'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/webmachine-1.5.0/lib/webmachine/decision/fsm.rb:31:in `block in run'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/webmachine-1.5.0/lib/webmachine/decision/fsm.rb:29:in `loop'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/webmachine-1.5.0/lib/webmachine/decision/fsm.rb:29:in `run'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/webmachine-1.5.0/lib/webmachine/dispatcher.rb:46:in `block in dispatch'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/as-notifications-1.0.1/lib/as/notifications.rb:161:in `instrument'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/webmachine-1.5.0/lib/webmachine/events.rb:75:in `instrument'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/webmachine-1.5.0/lib/webmachine/dispatcher.rb:45:in `dispatch'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/webmachine-1.5.0/lib/webmachine/adapters/rack.rb:68:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/cascade.rb:47:in `block in call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/cascade.rb:38:in `each'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/cascade.rb:38:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/pact_broker-2.59.2/lib/rack/pact_broker/database_transaction.rb:46:in `block in call_with_transaction'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/sequel-5.35.0/lib/sequel/database/transactions.rb:258:in `_transaction'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/sequel-5.35.0/lib/sequel/database/transactions.rb:233:in `block in transaction'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/sequel-5.35.0/lib/sequel/connection_pool/threaded.rb:92:in `hold'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/sequel-5.35.0/lib/sequel/database/connecting.rb:270:in `synchronize'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/sequel-5.35.0/lib/sequel/database/transactions.rb:195:in `transaction'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/pact_broker-2.59.2/lib/rack/pact_broker/database_transaction.rb:45:in `call_with_transaction'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/pact_broker-2.59.2/lib/rack/pact_broker/database_transaction.rb:24:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/pact_broker-2.59.2/lib/rack/pact_broker/convert_404_to_hal.rb:10:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/pact_broker-2.59.2/lib/rack/pact_broker/no_auth.rb:9:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/builder.rb:244:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/cascade.rb:47:in `block in call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/cascade.rb:38:in `each'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/cascade.rb:38:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/urlmap.rb:74:in `block in call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/urlmap.rb:58:in `each'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/urlmap.rb:58:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/static.rb:161:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/pact_broker-2.59.2/lib/rack/hal_browser/redirect.rb:20:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/pact_broker-2.59.2/lib/rack/pact_broker/convert_file_extension_to_accept_header.rb:28:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/static.rb:161:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/static.rb:161:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/pact_broker-2.59.2/lib/rack/pact_broker/add_vary_header.rb:34:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/pact_broker-2.59.2/lib/rack/pact_broker/add_pact_broker_version_header.rb:14:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/pact_broker-2.59.2/lib/rack/pact_broker/reset_thread_data.rb:13:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/pact_broker-2.59.2/lib/rack/pact_broker/invalid_uri_protection.rb:24:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/pact_broker-2.59.2/lib/rack/pact_broker/use_when.rb:30:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/rack-protection-2.0.8.1/lib/rack/protection/content_security_policy.rb:73:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/pact_broker-2.59.2/lib/rack/pact_broker/use_when.rb:28:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/rack-protection-2.0.8.1/lib/rack/protection/xss_header.rb:18:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/rack-protection-2.0.8.1/lib/rack/protection/json_csrf.rb:26:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/rack-protection-2.0.8.1/lib/rack/protection/base.rb:50:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/rack-protection-2.0.8.1/lib/rack/protection/frame_options.rb:31:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/builder.rb:244:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/pact_broker-2.59.2/lib/pact_broker/app.rb:72:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/lib/puma/configuration.rb:227:in `call'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/lib/puma/server.rb:706:in `handle_request'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/lib/puma/server.rb:476:in `process_client'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/lib/puma/server.rb:334:in `block in run'", "/pact_broker/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/lib/puma/thread_pool.rb:135:in `block in spawn_thread'"] } }```

brendan.donegan
2020-11-11 11:16
I?ve previously added webhooks successfully with the same payload, which in general looks like: ``` { "consumer": { "name": "My Consumer" }, "events": [ { "name": "provider_verification_published" } ], "request": { "method": "POST", "url": "https://ghe.my.org/api/v3/repos/Ed-Learning/lift/statuses/${pactbroker.consumerVersionNumber}", "body": { "state": "${pactbroker.githubVerificationStatus}", "description": "Pact Verification Tests", "context": "${pactbroker.providerName} ${pactbroker.providerVersionTags}", "target_url": "${pactbroker.verificationResultUrl}" }, "headers": { "Content-Type": "application/json", "Authorization": "Bearer token" } } }```

brendan.donegan
2020-11-11 11:16
Some information redacted of course, the consumer name, GHE hostname and authorization token are all different and I have updated them in the POST request actually sent

brendan.donegan
2020-11-11 11:24
Kind of looks like a bug, given the error: `?undefined local variable or method `decoractor_options' for #<PactBroker::Api::Resources::PactWebhooks:0x00007f3afd1df3f0>",`

brendan.donegan
2020-11-11 11:24
?decoractor_options??

matt.fellows
2020-11-11 11:48
Yes that looks like a bug indeed

matt.fellows
2020-11-11 11:50
We'll get that sorted asap

brendan.donegan
2020-11-11 12:12
I?m on 2.59.2

ukrainian1991
2020-11-11 15:02
has joined #pact-broker

ukrainian1991
2020-11-11 15:03
Hi, I got an error "413 Request Entity Too Large" when trying to publish my PACT file to pact broker. It has 13 ?B size

ukrainian1991
2020-11-11 15:03
Is there any option to limit maximum size?

ukrainian1991
2020-11-11 15:06
seems it's nginx limitation

ukrainian1991
2020-11-11 15:06
client_max_body_size

uglyog
2020-11-11 22:37
This has been fixed in a later version


bethskurrie
2020-11-12 00:50
@brendan.donegan that's fixed in the latest version

bethskurrie
2020-11-12 00:51
What does your pact file have in it @ukrainian1991? :scream:

bethskurrie
2020-11-12 00:53
Or a month ago even :stuck_out_tongue:

matt.fellows
2020-11-12 00:53
:smile:

matt.fellows
2020-11-12 00:53
indeed. I thought because Brendan is a Pactflow customer, it must have been a PF instance. But it turns out no :stuck_out_tongue:

bethskurrie
2020-11-12 00:56
I can bump it or make it configurable, but having a pact file that large is unusual. Are you putting binary data in it?

rodrigo.costa20
2020-11-12 00:59
has joined #pact-broker

yong.gong188
2020-11-12 09:13
has joined #pact-broker

anandhadeepak
2020-11-12 13:03
has joined #pact-broker

suresh.tsv
2020-11-12 16:38
has joined #pact-broker

suresh.tsv
2020-11-12 16:52
Hi, is it possible to send a can-I-deploy command using Http request. I am able find syntax for publish and tag a Pact. But for can-I-deploy I only see CLI request. Thanks in advance.


antonello
2020-11-12 17:20
I am not sure if you can do it for a specific version

david.dias
2020-11-12 20:04
has joined #pact-broker

suresh.tsv
2020-11-12 21:23
Thank you @antonello for your quick response. Please confirm if I understood it correctly. The above command tells the given pacticipant's latest version with a tag can be deployed with respect to other pacticipant with another tag. Here we are providing only one pacticipant's name. Are we assuming one to one relationship? The below CLI command allows us to mention both the pacticipants. pact-broker can-I-deploy - - pacticipant A - - version 1.0.1 - - pacticipant B - - latest prod Please advise. Thanks

bethskurrie
2020-11-12 23:14
HI @suresh.tsv the endpoint that @antonello mentioned is the simplified one that only supports asking if a particular version of one application can be deployed to a particular environment (specified by the given tag name).

bethskurrie
2020-11-12 23:14
so "can I deploy app Foo version 1 to production"

bethskurrie
2020-11-12 23:15
There is another endpoint to perform the multiple pacticipants together. If you run the can-i-deploy command with `--verbose` on, you'll see the HTTP query it makes. It's quite complicated however!

bethskurrie
2020-11-12 23:16
Can you explain what constraints you're under that mean you can't use the CLI?

guppy0356.nakira
2020-11-13 04:28
Does `pact-broker` have API for getting all contracts for one providers? In case of Lambda, I need to run `pact-provider-verifier` with contracts which have been downloaded in local. So, I want to know how to download contracts.

bethskurrie
2020-11-13 04:28
Yes. But maybe there's a better way. Can you explain why you need to do it that way rather than letting the provider verifier fetch them from the broker directly?


bethskurrie
2020-11-13 04:29
I still don't understand why you need to download the contracts.

guppy0356.nakira
2020-11-13 04:30
okay. please wait. I am not good at English :sweat:

guppy0356.nakira
2020-11-13 04:37
I think `pact-provider-verifier` expect locally saved contracts from README.md. ```pact-provider-verifier foo-bar.json --provider-base-url http://localhost:9292``` https://github.com/pact-foundation/pact-provider-verifier#simple-api

bethskurrie
2020-11-13 04:37
no

bethskurrie
2020-11-13 04:37
it expects pacts from the broker.

bethskurrie
2020-11-13 04:37
you can also give it local pacts, but it doesn't work best that way.

bethskurrie
2020-11-13 04:38
it won't publish the results back to the broker unless you fetched the pacts from the broker in the first place.

bethskurrie
2020-11-13 04:38
you won't be able to use WIP pacts and pending pacts unless you fetch the pacts from the broker.

guppy0356.nakira
2020-11-13 04:42
I understand. I can detect broker with `--pact-broker-base-url` . Your recommendation is use this option, isn't it?

bethskurrie
2020-11-13 04:42
yes

bethskurrie
2020-11-13 04:42
you need to provide the provider's name, the broker base url and the broker credentials (basic auth or bearer token)

guppy0356.nakira
2020-11-13 04:43
Thanks a lot :pancakes:

bethskurrie
2020-11-13 04:43
```Description: The parameters used when fetching pacts dynamically from a Pact Broker are: --pact-broker-base-url (REQUIRED) --provider (REQUIRED) --broker-username/--broker-password or --broker-token --consumer-version-tag or --consumer-version-selector --enable-pending --include-wip-pacts-since```


bethskurrie
2020-11-13 04:44
``` To publish verification results for either of the above scenarios, set: --publish-verification-results (REQUIRED) --provider-app-version (REQUIRED) --provider-version-tag or --tag-with-git-branch```

guppy0356.nakira
2020-11-13 09:30
Hi, Is it possible to upload contracts to S3 and S3 sends them to broker?

matt.fellows
2020-11-13 09:38
you would have to script it, but yes, the broker is fully API driven so that?s possible. But? why?

billal.patel
2020-11-13 10:31
has joined #pact-broker

guppy0356.nakira
2020-11-13 11:43
@matt.fellows This question is ust my curiosity :smile: Contract will be uploaded by http protocol, right? If contract is huge size, broker can't receive this contract.

brendan.donegan
2020-11-13 11:45
does anyone know how to add a webhook that uses x-www-form-urlencoded data as part of the request?

brendan.donegan
2020-11-13 11:46
Jenkins (seems to) insist on this

brendan.donegan
2020-11-13 11:51
I see the advice to use pact-broker create-webhook. Will try that

suresh.tsv
2020-11-13 12:05
Hi @bethskurrie Thank you for the clarification. We are currently working on a POC with Pact. So in initial stages we want to use cURL to send Http requests by ignoring SSL communication from GitLab pipeline to Pact Broker. We will be using CLI in later stages. Also on the provider side we are using Pact with Spring boot. The test has @PactBroker annotation to publish the verification results. Is it possible to ignore SSL verification while test communicates with the broker? Thanks again.

ukrainian1991
2020-11-13 13:47
As I write below, it was due to nginx behaviour. I specified pact broker URL to nginx (http://broker), but it works when I specify http://broker:9292

joaquin
2020-11-13 14:57
Hi all! I posted this issue https://github.com/pact-foundation/pact-provider-verifier/issues/61 ¿anyone here with some input about it?

simon.nizov
2020-11-13 15:21
Question about webhooks: When a pact changes in a feature branch, I want to use the `contract_content_changed` webhook to trigger a provider build to verify that pact. But how do I know which ?main? branch (environment) the consumer is planning to merge the feature branch to, so that I can perform verification on the latest provider in that environment? That pact will be tagged with the feature branch name, so the broker doesn?t really know where the pact is ?headed to?, does it?

phil.endsley
2020-11-13 15:46
I'm trying to wrap my head around this... So you would have something like: 2 different environments (ex: dev1 and dev2) running different versions of consumer/provider env1 Consumer: main Provider: main env2 Consumer: feat-x Provider: feat-y And you want to know that if `feat-x` changes, provider verification is ran on `feat-y` branch of the provider? > so the broker doesn?t really know where the pact is ?headed to?, does it? Correct, because it's not necessarily headed anywhere. It's just a new version of the contract for a consumer

simon.nizov
2020-11-13 15:53
Nope, the set up is like this: *env1* Consumer branches: env1 Provider branches: env1 *env2* Consumer branches: env2 Provider branches: env2 Both the consumer and the provider have these branches whose names match the environment they are deployed to Now, when I create a *feat-x* branch out of env1, I want the provider of env1 to run the verification, because that?s where *feat-x* is going to be merged and deployed to. Hope that makes more sense @phil.endsley

antonello
2020-11-13 16:40
@simon.nizov, unless I?m misunderstanding your problem, the dynamic variable substitution should help https://docs.pact.io/pact_broker/advanced_topics/api_docs/webhooks/#dynamic-variable-substitution

antonello
2020-11-13 16:44
`${pactbroker.consumerVersionTags}` would do the job for you I think?

simon.nizov
2020-11-13 16:46
@antonello I thought so too but for example `${pactbroker.consumerVersionTags}` will pass `feat-x` to the provider build. How do I then know that I should verify the provider version that is in `env1`?

antonello
2020-11-13 16:48
gotcha

antonello
2020-11-13 16:49
I?m a bit confused by set up though.

antonello
2020-11-13 16:49
what are env1 and env2 branches of?

simon.nizov
2020-11-13 16:51
@antonello Imagine you have multiple environments - qa, staging, etc.. The code that is running in those envs sits in branches with a matching name, in each service. So for example, environment ?staging? runs code that is in a branch called `staging`. Both in the consumer and the provider.

antonello
2020-11-13 16:53
ok - so a non-trunk based set-up with some sort of integration branches

antonello
2020-11-13 16:53
which branch do you build your production artifacts from?

simon.nizov
2020-11-13 16:55
staging

antonello
2020-11-13 16:58
it?s a bit convoluted and a bit of a slippery slope, but if you want to be as close as possible to pact nirvana, you might want to a webhook for all environments that matter.

antonello
2020-11-13 16:59
unless your consumer and provider are always deployed together?

phil.endsley
2020-11-13 17:00
@simon.nizov is there any way to determine where you branched from? If so, maybe you could leverage another set of tags? Only thing I can think of right now...will continue to mull it over though

antonello
2020-11-13 17:03
just to explain what I mean with an example, unless you deploy your consumer and provider together, your feature branches (whether they are from the `qa` or `staging` branch) would always trigger provider builds for both `qa` and `staging` branches, to make sure that you?re compatible with both.

suresh.tsv
2020-11-13 17:08
Hi, I am working on a Spring boot application which has a test to verify Pacts. @PactBroker annotation is used to configure Pact Broker host and port details, with SSL scheme. Is there a way I can disable SSL validation while calling Pact Broker? I mean allowing insecure call. This is needed temporarily for a POC. Thanks in advance.

simon.nizov
2020-11-13 17:08
@antonello That might work yeah. @phil.endsley One thing I thought of was this - publish the pact when a PR is opened. Then I can theoretically pull the base branch of the PR using Github?s API.

antonello
2020-11-13 17:18
At one point I was scratching my head with similar problems (before we decided to go for a simpler approach), and the only thing I could think of was to create a middle man.

antonello
2020-11-13 17:20
a simple web app that would receive webhook requests and then apply some logic to decide which branches to trigger.

phil.endsley
2020-11-13 17:35
I think that would make sense if you have some deterministic way of figuring out where you branched from. Otherwise, I don't think there's a way to automate that process... I agree with @antonello's suggestion of having a webhook for each environment. If you use pending pacts, it won't fail the build for wrong environments, but will still publish verification results.

phil.endsley
2020-11-13 17:36
@antonello :taco:

simon.nizov
2020-11-13 17:54
@antonello yeah, my idea with github would have to be done in a middleman like you described. I was thinking even simpler than a web app though - an aws lambda function. I had a feeling that I'm running into this issue because our setup isn't standard. Thanks for clearing that up for me guys!

simon.nizov
2020-11-13 17:55
@antonello :taco:

simon.nizov
2020-11-13 17:55
@phil.endsley :taco:

suresh.tsv
2020-11-13 20:38
[PACT BROKER behind API Gateway] Hi, we are facing an issue with verification while running Pact Broker behind Kong API Gateway. Provider is a Spring Boot application. When the test for verification is executed it is using the Gateway host and port to connect to the Broker behind it. However in the JSON response returned, the broker is including the links to actual Broker host name with default port. Hence the Provider is trying to connect to the Broker directly for further communication causing connection failure. How can we fix this such that response returned from Pact Broker includes the Gateway host name and port. Please help. Thanks


matt.fellows
2020-11-13 20:47
Check with #pact-jvm but pretty sure same way you'd do it for anything in Java. Add your cert to the trust store

suresh.tsv
2020-11-13 20:53
Thank you @matt.fellows for very quick response. We will try the suggested settings.

suresh.tsv
2020-11-13 21:09
Thank you @matt.fellows. Just did the same. Actually wanted to ignore it but couldn't figure out.

matt.fellows
2020-11-13 21:44
Why is it so big?

matt.fellows
2020-11-13 21:45
If you're hosting your own you could increase the limits

matt.fellows
2020-11-13 21:45
But I'd recommend avoiding uploading big contracts if you can avoid it

matt.fellows
2020-11-13 21:46
You can still use self signed certs with the CLI. You can export some Env vars to trust the cert

bethskurrie
2020-11-13 23:54
> a simple web app that would receive webhook requests and then apply some logic to decide which branches to trigger. @simon.nizov Yes, I agree with Anto's proxy suggestion. I recommend in this situation that there is an intermediate build in your CI that accepts all the webhooks, and then works out what needs to be built, and then creates another build with the correct branches/versions of everything.

bethskurrie
2020-11-13 23:56
@guppy0356.nakira what are you putting in your contracts that is that big?

bethskurrie
2020-11-13 23:56
Yes, you can just set the header to form encoded.

bethskurrie
2020-11-13 23:56
You'll need to set the body as a string form.


bethskurrie
2020-11-13 23:58
Here's an example using docker compose with a self signed cert https://github.com/DiUS/pact_broker-docker/blob/master/docker-compose.yml#L43

bethskurrie
2020-11-14 00:00
@suresh.tsv it will be much easier to set the self signed cert than to try and replicate the can-i-deploy commands as a CURL. It's not a user friendly request.

bethskurrie
2020-11-14 00:01
If this is a POC, and you have an internally deployed Pact Broker (not Pactflow), can you ask your ops team to disable SSL while you do the POC?

simon.nizov
2020-11-14 07:24
@bethskurrie thanks. I don't think I can do that with Drone CI though. The proxy has to be external

bethskurrie
2020-11-14 07:25
A build can't trigger another build?!

simon.nizov
2020-11-14 08:12
I don't think so... There's a rest API that can be used to trigger a build. I guess it can be called from another build to achieve a build triggering another build. But I don't think there's anything native.

bethskurrie
2020-11-14 08:15
v strange.

bethskurrie
2020-11-14 08:17
Github Actions is a bit like that though. You have to call the API to trigger another Github Action.


bethskurrie
2020-11-14 08:18
That's pretty much what I was imagining.

simon.nizov
2020-11-14 08:30
Yep, this whole thread originated from me wondering what to pass in that `branch={branch}` param

bethskurrie
2020-11-14 08:35
Lots of teams do matching feature branche names on consumer/provider.

bethskurrie
2020-11-14 08:35
To solve this exact problem.

simon.nizov
2020-11-14 11:57
Yes that can help, but sometimes a pact can change without requiring the provider to change anything. So no need for a matching branch on the provider

jayeshdalal7
2020-11-15 10:41
has joined #pact-broker

bethskurrie
2020-11-15 22:55
@simon.nizov yes, that's why there's a "fallbackTag" for when there is no matching branch.

bethskurrie
2020-11-15 22:57
But that doesn't help with the webhook flow

guppy0356.nakira
2020-11-15 23:58
@bethskurrie It's base64 encoded image.

bethskurrie
2020-11-15 23:58
What benefits are you getting from using real big images?

guppy0356.nakira
2020-11-16 00:04
Hmm, It' s just my curiosity.

bethskurrie
2020-11-16 00:04
I think you'd be better off using a very small placeholder image.

bethskurrie
2020-11-16 00:04
Pacts aren't meant to be 10s of MB.

guppy0356.nakira
2020-11-16 03:09
In `technical details` , I cannot understand this sentence. ```Discard all the pacts that were published before the first instance of this provider tag (this is so that if you create a brand new provider branch, you don't get EVERY head pact included in the WIP pacts list).``` ref https://docs.pact.io/pact_broker/advanced_topics/wip_pacts/#technical-details Tried Steps to understand: 1. Consumer upload contract with `master` tag and provider verify and upload its result with `master` tag. 2. Provider also verify current contract with `feat-z` tag. 3. Consumer add some examples with `feat-x` tag. After that, add some examples with `feat-y` tag. 4. Provider will verify `feat-y` only. :point_left: Is this correct? In case of `includeWipPactsSince` is `"2020-01-01"` , I think provider can verify `feat-x` and `feat-y`. Maybe I don't understand wip pact but I understand pending pact. Pending pact is for provider, isn't it? If consumer upload new request contract which is not supported by provider, provider ci will fails but exit status is 0 (success). So, this failure result not affect deploy step.

guppy0356.nakira
2020-11-16 05:53
What is the difference between `--contract-content-changed` and `--contract-published` in create-webhook.

bethskurrie
2020-11-16 05:54
One fires every time a pact is published. One fires only if the content has changed when it is published.

bethskurrie
2020-11-16 05:55
Most of the time, the contract that is published has exactly the same content as the one before it. They tend to change rarely (as a proportion of overall commits) once an API has stablised.

guppy0356.nakira
2020-11-16 06:10
I want to fire event on every publish. So, `--contract-content-changed` is prefer?

bethskurrie
2020-11-16 06:10
no...

bethskurrie
2020-11-16 06:10
you want --contract-published.

bethskurrie
2020-11-16 06:10
Sorry, I'm not sure what is unclear about the names.

bethskurrie
2020-11-16 06:11
What thing do you want to trigger?

guppy0356.nakira
2020-11-16 06:13
publish contract and upload verification results.

bethskurrie
2020-11-16 06:14
I don't think we understand each other.

guppy0356.nakira
2020-11-16 06:14
sorry..

bethskurrie
2020-11-16 06:14
The webhook causes an HTTP request (that you configure) to be performed when an event happens in the Pact Broker.

bethskurrie
2020-11-16 06:14
The webhook does not publish a pact or upload verification results.

bethskurrie
2020-11-16 06:15
A webhook is triggered when pacts are published or when verification results are published.

bethskurrie
2020-11-16 06:15
It happens after.

bethskurrie
2020-11-16 06:18
Yes, it seems you understand pending pacts.

bethskurrie
2020-11-16 06:19
The WIP pacts feature is designed to allow you to verify the "outstanding" pacts without having to change your configuration.

bethskurrie
2020-11-16 06:21
We exclude any pacts created before the first instance of the tag, because if we did not, every time we created a new branch, every head pact ever created would be considered WIP.


bethskurrie
2020-11-16 06:22
Here is a test that shows the behaviour.

guppy0356.nakira
2020-11-16 06:26
Sorry Beth. Please go back to the main subject. ```[--contract-content-changed], [--no-contract-content-changed] # Trigger this webhook when the pact content changes [--contract-published], [--no-contract-published] # Trigger this webhook when a pact is published``` ref https://github.com/pact-foundation/pact_broker-client#create-webhook ```Trigger this webhook when a pact is published``` and ```# Trigger this webhook when the pact content changes``` is same meaning for me because publish is changing something.

bethskurrie
2020-11-16 06:27
For me to tell you whether to use --contract-content-changed or --contract-published I need to understand what you want the webhook to do.

bethskurrie
2020-11-16 06:27
> publish is changing something We have different ideas of what publish means then.

bethskurrie
2020-11-16 06:27
You can publish the same thing over and over. Publish just means "making a thing available for someone else to use".

bethskurrie
2020-11-16 06:29
You could publish the same jar file over and over with a different version number (it would be silly, but you could do it).

bethskurrie
2020-11-16 06:30
You can publish the same pact JSON content over and over again, with a different consumer version number.

bethskurrie
2020-11-16 06:30
publish != content changed.

bethskurrie
2020-11-16 06:30
it just means "content made available for someone else to access"

bethskurrie
2020-11-16 06:55
```curl -X PUT \ -H "Content-Type: application/json" \ -d "< pact content 1 >" http://test.pactflow.io/pacts/provider/Bar/consumer/Foo/version/1 -> triggers contract_published and contract_content_changed (first ever pact always triggeres change) curl -X PUT \ -H "Content-Type: application/json" \ -d "< pact content 1 >" http://test.pactflow.io/pacts/provider/Bar/consumer/Foo/version/2 -> triggers contract_published (content is the same as before) curl -X PUT \ -H "Content-Type: application/json" \ -d "< pact content 2 >" http://test.pactflow.io/pacts/provider/Bar/consumer/Foo/version/3 -> triggers contract_published and contract_content_changed (the content is different from the previous publication) ```

guppy0356.nakira
2020-11-16 07:04
I understand :laughing:

guppy0356.nakira
2020-11-16 07:08
I run `pact-broker can-i-deploy --retry-while-unknown 5 --retry-interval 30 ...` but returns `Computer says no` soon. Why???

guppy0356.nakira
2020-11-16 07:13
I will add more details. It seems no retrying command.

bethskurrie
2020-11-16 07:45
It only reties if there is a result *missing*

bethskurrie
2020-11-16 07:45
If there is a result already, and it is a failure, it will return immediately.

bethskurrie
2020-11-16 07:46
@guppy0356.nakira I recommend doing the CI/CD workshop https://docs.pactflow.io/docs/workshops/ci-cd/

guppy0356.nakira
2020-11-16 07:48
Hmm, no result.

bethskurrie
2020-11-16 07:49
Publish pact with content "1234" for consumer version 1 Provider runs verification - fails - publishes results Publish pact with content "1234" for consumer version 2 can-i-deploy --retry-while-unknown X will say "no" immediately, because there is a result for pact with content "1234", and is failed.

bethskurrie
2020-11-16 07:50
Publish pact with content "1234" for consumer version 1 Provider runs verification - fails - publishes results Publish pact with content "4567" for consumer version 2 can-i-deploy --retry-while-unknown X will poll because there is no verification result for pact with content "4567"



bethskurrie
2020-11-16 07:51
:party_parrot:

guppy0356.nakira
2020-11-16 07:54
I tried but still confusing. sorry.. :sob:

antonello
2020-11-16 08:07
Which points specifically are confusing?

louis.oliver
2020-11-16 10:33
has joined #pact-broker

mateusz.derks
2020-11-16 10:56
I got it working in a simple isolated setup, so it must be something misconfigured on our project.

guppy0356.nakira
2020-11-16 13:02
Hmm, my native language is Japanese. Long English sentence sometimes is complicated.

antonello
2020-11-16 13:05
I see. Well, if there are any particular sentences you?re struggling with, do reach out.

ashishkujoy
2020-11-16 15:08
has joined #pact-broker

mateusz.derks
2020-11-16 20:41
We have a mix consumer configuration like ```Pact.service_provider('My Provider') do honours_pacts_from_pact_broker do end end Pact.service_provider('My Provider') do honours_pact_with('My Consumer 1') do end end Pact.service_provider('My Provider') do honours_pact_with('My Consumer 2') do end end``` maybe it causes some conflict :thinking_face: I need to dig deeper

guppy0356.nakira
2020-11-17 00:48
I'm doing CI/CD workshop now. Are there any steps to configure a trigger to run consumer verification build. I think consumer build need to re-run `can-i-deploy` job to detect provider verification result. I'm sorry if I skipped it.

bethskurrie
2020-11-17 00:49
You can add a webhook to trigger a consumer build if you like.

bethskurrie
2020-11-17 00:49
People don't tend to use one, but there's no reason you can't.

bethskurrie
2020-11-17 00:52
You'd need to use the webhook template parameters to make sure you built the correct sha/branch of the consumer.

guppy0356.nakira
2020-11-17 00:55
How to detect correct sha/branch of the consumer?

bethskurrie
2020-11-17 01:02
Make a webhook that runs for "provider verification succeeded" and passes the `${pactbroker.consumerVersionNumber}` back to the consumer build.

bethskurrie
2020-11-17 01:02
The same way that you'd pass the `${pactbroker.pactUrl}` to the provider build.

guppy0356.nakira
2020-11-17 01:26
I will try. By the way, are there any options to update target branch. ``````

guppy0356.nakira
2020-11-17 01:28
```{ "request": { "message": "Triggered by changed pact for ${pactbroker.consumerName} version ${pactbroker.consumerVersionNumber}", "branch": "master", "merge_mode": "deep_merge_append", "config": { "env": { "global": [ "PACT_URL=${pactbroker.pactUrl}" ] } } } }``` Target branch is always master. I want to update this target branch. Combination is like this. 1. (consumer) feat-x and (provider) develop 2. (consumer) prod and (provider) prod

bethskurrie
2020-11-17 02:13
You'll need to look at the travis documentation to answer that @guppy0356.nakira

bethskurrie
2020-11-17 02:14
There's no way to do the mapping in the webhook. There is no logic. You would have to trigger a travis build, passing all the vars through, do the logic inside that build, and trigger another build with the right branch set.

pradeepchoube
2020-11-17 03:49
has joined #pact-broker

guppy0356.nakira
2020-11-17 08:06
When consumer publish contract to broker, broker fires webhook on receiving. Does `${pactbroker.consumerVersionTags}` have only one tag?

bethskurrie
2020-11-17 08:08
If you've only given it one tag, it will only have one tag.

guppy0356.nakira
2020-11-17 08:11
oh! I really understand! This variable shows tags which are related with ONE contract, isn't it?

bethskurrie
2020-11-17 08:11
yes. the one that caused the webhook to be fired.

guppy0356.nakira
2020-11-17 08:17
How about provider verification? Provider can verify some versioned contracts and publish results. Broker fires webhook on each publish and relpace `${pactbroker.consumerVersionTags}` to the tags which are related with ONE contract. It doesn't all tags which is related with ALL contracts.

bethskurrie
2020-11-17 08:18
If you've used the ${pactbroker.pactUrl} to pass the pact to verify, it puts the original consumer version and tag into the metadata which is base64 encoded in the URL.

bethskurrie
2020-11-17 08:19
When the verification results are published back, it sends that metadata back with the results in the URL.

bethskurrie
2020-11-17 08:19
So it should just work if you use it as recommended.

bethskurrie
2020-11-17 08:20
If the results are from a verification where the pacts for all consumers are verified, it will use the latest consumer version with that content.

bethskurrie
2020-11-17 08:30
Here's an example of a script that might run on the consumer side when triggered by a "provider verification result succeeded" webhook https://github.com/pact-foundation/pact_broker-client/blob/master/example/scripts/deploy-consumer.sh

guppy0356.nakira
2020-11-17 08:31
Thank you. I will check :eyes:

meng-lingtao
2020-11-17 14:39
has joined #pact-broker

pabvidcal
2020-11-17 15:30
has joined #pact-broker

magesh.nagamani
2020-11-18 05:15
has joined #pact-broker

mateusz.derks
2020-11-18 10:22
Actually the verification done with `honours_pacts_from_pact_broker` kept pact as WIP, but it stopped being WIP when I selected it by URL ```Pact.service_provider(provider) do honours_pact_with(consumer) do pact_uri url end end``` when such verification is published to the broker, the pact selected by URL is no longer considered WIP. I will try to reproduce the same behavior on my isolated environment so I can share it publicly.

mateusz.derks
2020-11-18 13:24
@bethskurrie I put it all together in this example repo https://github.com/ertrzyiks/pact-playground/blob/main/issues/wip.md TLDR a contract is no longer WIP when it?s being verified by pact URL. Is that intentional?

jstoebel
2020-11-18 13:53
has joined #pact-broker

daniel.sayer89
2020-11-19 10:33
has joined #pact-broker

art.ptushkin
2020-11-19 10:34
has joined #pact-broker

pact457
2020-11-19 10:36
has joined #pact-broker

ajerthan.sivayoganath
2020-11-19 10:38
has joined #pact-broker

philipchardwick
2020-11-19 11:05
has joined #pact-broker

tanzmann
2020-11-19 11:09
has joined #pact-broker

olivier.quere
2020-11-19 12:10
has joined #pact-broker

wilfried.vandenberghe
2020-11-19 12:20
has joined #pact-broker

alessio.paciello
2020-11-19 16:14
has joined #pact-broker

alan.hanafy
2020-11-19 19:28
has joined #pact-broker

michael.deutscher
2020-11-19 21:39
has joined #pact-broker

jarmy
2020-11-19 23:04
Is `can-i-deploy` traditionally called by consumers? I?m wondering if it can be used by providers to check if the have verified the contract with their consumers before deploying

bethskurrie
2020-11-19 23:04
both @jarmy

matt.fellows
2020-11-19 23:04
Both

bethskurrie
2020-11-19 23:05
Both sides need it because even after the tests have run, either side could deploy a new version before the other does

bethskurrie
2020-11-19 23:06
And if you have pending pacts turned on (so your build doesn't fail if a consumer changes a pact on the main branch) you need it to ensure you're safe because your build won't have failed.

jarmy
2020-11-19 23:06
I suspected so. This https://docs.pact.io/pact_broker/webhooks/#consumer-ci seems to favor the consumer

bethskurrie
2020-11-19 23:07
Hm, yes, I can see why you'd think so. It doesn't list the full provider pipeline, just the test jobs.

bethskurrie
2020-11-19 23:10
I've just done a quick update to the text. It should be deployed in a few minutes.

jarmy
2020-11-19 23:22
cool. the update helps

matt.fellows
2020-11-20 01:32
@ercalbwar just wanted to follow this up. We?d love to get your Jenkins template and setup instructions into our libary. Would you be open to sharing here, or better yet, submitting a PR?

gerry.power
2020-11-20 03:31
has joined #pact-broker

alex900
2020-11-20 05:08
has joined #pact-broker

mateusz.derks
2020-11-20 07:30
Is that intentional that veryfing pact by URL makes it no longer WIP? I replicated our setup in simplified environment and noticed that WIP status is kept when I verify asking broker for contracts but is lost when I use direct URL https://github.com/ertrzyiks/pact-playground/blob/main/issues/wip.md

tomas.panik
2020-11-20 08:28
has joined #pact-broker

brendan.donegan
2020-11-20 09:04
I haven?t used this feature much but I think it may rely on the broker to determine that status - https://docs.pact.io/pact_broker/advanced_topics/pending_pacts


mateusz.derks
2020-11-20 09:33
Yes, it works like a charm as long as I pass base url of broker and consumer version selectors for verification. If the same contract is verified by the pact file URL this contract is no longer selected by WIP condition.

brendan.donegan
2020-11-20 09:35
If I had to guess how this works (and one of the maintainers can correct me), I would say the Broker itself is dynamically injecting the required fields into the contract before sending it down to the provider

brendan.donegan
2020-11-20 09:35
If you just give it the raw file it can?t do this

ercalbwar
2020-11-20 10:33
For sure! I have a couple of busy weeks coming up but I will have plenty of time in the holiday break. I will add this to my list :)

matt.fellows
2020-11-20 11:37
Correct Brendon, or at leas your intuition is on point. The broker does the pending calculation based on its state, and sends back some extra relations in the hypermedia response for the client code to publish the verification results to.

matt.fellows
2020-11-20 11:37
The direct URL case is interesting on the pending stuff. I haven?t put the same amount of thought into it as @bethskurrie, but I can see an argument either way here.

mateusz.derks
2020-11-20 11:46
Thanks for the confirmation @matt.fellows . It?s good to understand the technical explanation of what is going on. It causes issues with the `contract_content_changed` webhook since once a job triggered by https://docs.pact.io/pact_broker/webhooks/template_library#github---trigger-build is green, the feature branch is excluded from WIP filter. It?s partially because we get the webhook called even if the contract is not changed (I suspected https://github.com/pact-foundation/pact-js/issues/524, but it?s not the case apparently). I?m still digging why we schedule a job after pushing a new tag without any changes. That?s a separate topic though.

brendan.donegan
2020-11-20 11:47
@mateusz.derks we have one contract which always changes because the developer has put the timestamp in it

brendan.donegan
2020-11-20 11:47
It could be something like that

mateusz.derks
2020-11-20 11:49
@brendan.donegan Good point. We had such thing but I eliminated all the random differences in the pact file. Also `can-i-deploy` immediately knows that the contract is verified, the webhook is called anyway. I think if there is any change in the contract file it would be missing verification right after being published.

mateusz.derks
2020-11-20 11:51
So what we get is: ? have a new branch with no apparent changes to the pact ? pact published to the broker ? can-i-deploy returns :white_check_mark: right away ? the verification job is triggered anyway (by the webhook?) and the branch is no longer WIP

mateusz.derks
2020-11-20 11:59
The webhook is configured to make GET request adding `${pactbroker.pactUrl}` as a query param, and pactUrl is like ```https://my-broker/pacts/provider/PROVIDER/consumer/CONSUMER/pact-version/VERSION/metadata/METADATA``` The VERSION is the same for all the unnecessary jobs, only METADATA is different (different consumer version tag when base64 decoded).

mateusz.derks
2020-11-20 12:36
I see that `contract_content_changed` webhook is also called when we publish a very first version of a tag :thinking_face: It may be related to our overscheduling the jobs. Anyway, the question is still if a verification by URL should undo WIP status.

mateusz.derks
2020-11-20 12:38
I started another thread with the findings

mateusz.derks
2020-11-20 12:43
Yes, it explains everything. We have a WIP master branch. Then we create a feature branch on top of it. This feature branch has no changes to pact on its own, but since it publishes the master's version of pact with a new tag it triggers the webhook with content change. The verification of feature branch contract makes master branch no longer WIP because they point to the same contract sha.

marc.ferland
2020-11-20 14:43
has joined #pact-broker

sebastien.crapoulet
2020-11-20 15:24
has joined #pact-broker

adutrillaux
2020-11-20 15:28
has joined #pact-broker

he
2020-11-20 15:59
has joined #pact-broker

ivgeni.slabkovski
2020-11-20 21:52
has joined #pact-broker

serhatburakyildirim
2020-11-21 21:57
has joined #pact-broker

alnasl
2020-11-22 18:46
has joined #pact-broker

ashutosh23802
2020-11-23 06:20
has joined #pact-broker

leonty
2020-11-23 10:33
has joined #pact-broker

dariusz.piwko
2020-11-23 11:34
has joined #pact-broker

praneeth.kumar
2020-11-23 16:18
has joined #pact-broker

bethskurrie
2020-11-23 21:22
So, the rule is, "if it is verified successfully while it was included as WIP then it remains WIP".

bethskurrie
2020-11-23 21:23
So, there's a wip=true in that metadata when you verify using the 'pacts for verification' API that isn't there in the direct URL. But... I think I could just add it to the URL of the pact that is being verified by webhook. I'll have to have a think about the consequences of this.

bethskurrie
2020-11-23 21:27
My initial feeling is that it will work. @mateusz.derks are you using your own hosted broker? If I put that change into an edge version, could you install it and try it out?

jarmy
2020-11-24 00:26
Hi. We have branches (e.g. `task/GRNWEB-2077-fast-follow`) that are supposed to be added when a pact is published ```Publishing pacts to broker at: https://pact-broker.docker.savagebeast.com/ 12:16:50 [2020-11-23T20:16:50.640Z] INFO: pact-node@10.11.0/66205 on jenkins-build-agent-09: 12:16:50 12:16:50 Tagging version 548f6b61 of web as "task/GRNWEB-2077-fast-follow" 12:16:50 Publishing web/pegasus pact to pact broker at https://pact-broker.docker.savagebeast.com/``` However, the pact is uploaded but I'm not seeing that tag (or any like it) in our pact-broker (`2.57.0.0`). Is it possible the pact-broker is omitting tags with "/" in them?

bethskurrie
2020-11-24 00:26
Looks like pact-jvm?

bethskurrie
2020-11-24 00:27
Best to ask there, as that would be a client issue, not a server one.

bethskurrie
2020-11-24 00:27
Tags definitely support slashes in the server and the ruby client, as it's quite common for branch names to follow the "feat/x" format

bethskurrie
2020-11-24 00:27
Oh, no I can see pact-node referenced.

jarmy
2020-11-24 00:28
I posted in #pact-js too.

bethskurrie
2020-11-24 00:28
Can you reproduce it in the http://test.pactflow.io broker?

jarmy
2020-11-24 00:29
I can try. what would be the credentials?

bethskurrie
2020-11-24 00:30
Broker base URL: https://test.pact.dius.com.au username: dXfltyFMgNOFZAxr8io9wJ37iUpY42M password: O5AIZWxelWbLvqMd8PkAVycBJh2Psyg1

bethskurrie
2020-11-24 00:30
Is there any other output from that task?

bethskurrie
2020-11-24 00:31
There should be a line saying "the latest version of the pact is available at..."

bethskurrie
2020-11-24 00:31
is the consumer version resource created?

jarmy
2020-11-24 00:31
```12:16:50 Publishing to Pact broker 12:16:50 [2020-11-23T20:16:48.427Z] INFO: pact-node@10.11.0/66205 on jenkins-build-agent-09: Publishing Pacts to Broker 12:16:50 [2020-11-23T20:16:48.429Z] INFO: pact-node@10.11.0/66205 on jenkins-build-agent-09: Publishing pacts to broker at: https://pact-broker.docker.savagebeast.com/ 12:16:50 [2020-11-23T20:16:50.640Z] INFO: pact-node@10.11.0/66205 on jenkins-build-agent-09: 12:16:50 12:16:50 Tagging version 548f6b61 of web as "task/GRNWEB-2077-fast-follow" 12:16:50 Publishing web/pegasus pact to pact broker at https://pact-broker.docker.savagebeast.com/ 12:16:50 The latest version of this pact can be accessed at the following URL (use this to configure the provider verification): 12:16:50 https://pact-broker.docker.savagebeast.com/pacts/provider/pegasus/consumer/web/latest 12:16:50 12:16:50 12:16:50 Pact contract publishing complete!```

bethskurrie
2020-11-24 00:32
Can you put verbose on?

bethskurrie
2020-11-24 00:32
There's some setting in pact js that allows you to pass that through.

bethskurrie
2020-11-24 00:32
it could just be verbose: true


bethskurrie
2020-11-24 00:53
so, the tags look ok there, yes?

bethskurrie
2020-11-24 00:53
What version of the pact broker are you using on prem?

jarmy
2020-11-24 00:53
yes, let me try publishing tro our broker

jarmy
2020-11-24 00:53
we're using `2.57.0.0`

bethskurrie
2020-11-24 00:54
pretty recent. No changes to tags that I can think of since then.

jarmy
2020-11-24 01:00
ok, I've just published the same contract to our broker ```Tagging version fd292b0a of web as "task/test-pact-publish" Publishing web/pegasus pact to pact broker at https://pact-broker.docker.savagebeast.com/ The latest version of this pact can be accessed at the following URL (use this to configure the provider verification): https://pact-broker.docker.savagebeast.com/pacts/provider/pegasus/consumer/web/latest``` the tag was not applied to the pact

bethskurrie
2020-11-24 01:00
ok, we'll need the verbose output

bethskurrie
2020-11-24 01:00
that will have each http request

bethskurrie
2020-11-24 01:01
try `verbose: true`

jarmy
2020-11-24 01:02
I added it but that's all I get on the publish event. The rest (before the above message) looks related to opening the connection and the contract

bethskurrie
2020-11-24 01:02
try VERBOSE=true in the env vars


bethskurrie
2020-11-24 01:03
i suspect the js code isn't passing it through

bethskurrie
2020-11-24 01:04
bummer, I haven't made the env var work. just tried it

bethskurrie
2020-11-24 01:04
do me a favour, can you try publishing with the pact-cli docker image?

bethskurrie
2020-11-24 01:04
you can set the verbose flag on for that.


bethskurrie
2020-11-24 01:06
```docker run --rm \ -w ${PWD} \ -v ${PWD}:${PWD} \ -e PACT_BROKER_BASE_URL \ -e PACT_BROKER_USERNAME \ -e PACT_BROKER_PASSWORD \ pactfoundation/pact-cli:latest \ publish \ ${PWD}/example/pacts \ --consumer-app-version fake-git-sha-for-demo-$(date +%s) \ --tag "feat/foo" \ --verbose```

bethskurrie
2020-11-24 01:08
you should see this output

bethskurrie
2020-11-24 01:08
```<- "PUT /pacticipants/Pact%20Broker%20Client/versions/fake-git-sha-for-demo-1606180022/tags/feat%2Ffoo HTTP/1.1\r\nAccept: application/hal+json, application/json\r\nContent-Type: application/json\r\nContent-Length: 0\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nUser-Agent: Ruby\r\nAuthorization: Basic ZFhmbHR5Rk1nTk9GWkF4cjhpbzl3SjM3aVVwWTQyTTpPNUFJWld4ZWxXYkx2cU1kOFBrQVZ5Y0JKaDJQc3lnMQ==\r\nConnection: close\r\nHost: http://test.pact.dius.com.au\r\n\r\n" <- "" -> "HTTP/1.1 201 Created\r\n" -> "Date: Tue, 24 Nov 2020 01:07:05 GMT\r\n" -> "Content-Type: application/hal+json;charset=utf-8\r\n" -> "Content-Length: 572\r\n" -> "Connection: close\r\n" -> "Vary: Accept\r\n" -> "Location: https://test.pact.dius.com.au/pacticipants/Pact%20Broker%20Client/versions/fake-git-sha-for-demo-1606180022/tags/feat/foo\r\n" -> "Server: Webmachine-Ruby/1.5.0 Rack/1.3\r\n" -> "X-Pact-Broker-Version: 2.68.1\r\n" -> "X-Pact-Broker-Git-Sha: 74d3644d\r\n" -> "X-Pactflow-Git-Sha: b539f7bf\r\n" -> "X-Content-Type-Options: nosniff\r\n" -> "X-Request-Id: fdf6744f6745d92cfd564f2090de2aeb\r\n" -> "\r\n" reading 572 bytes...```

bethskurrie
2020-11-24 01:09
strange. the pact-js lib should support verbose: true

bethskurrie
2020-11-24 01:09
are you on an old version?

jarmy
2020-11-24 01:18
Relatively new AFAIK (`pact-node@10.10.1`) this is the output with verbose logging

bethskurrie
2020-11-24 01:19
ok, there's the critical bit

bethskurrie
2020-11-24 01:19
```<- "PUT /pacticipants/web/versions/fd292b0a/tags/task%2Ftest-pact-publish HTTP/1.1\r\nAccept: application/hal+json, application/json\r\nContent-Type: application/json\r\nContent-Length: 0\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nUser-Agent: Ruby\r\nConnection: close\r\nHost: http://pact-broker.docker.savagebeast.com\r\n\r\n" <- "" -> "HTTP/1.1 404 Not Found\r\n"```

bethskurrie
2020-11-24 01:19
I have something in my memory about this, just let me think what it is

bethskurrie
2020-11-24 01:25
are you using the dius or pact-foundation image?


bethskurrie
2020-11-24 01:26
righto. let me try it in a docker compose

jarmy
2020-11-24 01:40
I've got to sign off to take care of my son. I'll check back later.

bethskurrie
2020-11-24 01:40
np

bethskurrie
2020-11-24 01:47
ok, I've tried to recreate it


bethskurrie
2020-11-24 01:47
And run ```docker-compose -f docker-compose.yml up```

bethskurrie
2020-11-24 01:48
it may be the version of the standalone in the pact-js :thinking_face:

bethskurrie
2020-11-24 01:49
The simplest thing would be to upgrade to the latest version of the broker.

bethskurrie
2020-11-24 01:50
Given you could publish successfully to our test one, it seems that whatever issue there is doesn't exist in that version.

jarmy
2020-11-24 04:10
I'll try to upgrade to the latest tomorrow and will report back my findings.

bethskurrie
2020-11-24 04:16
:thumbsup::skin-tone-3:

mateusz.derks
2020-11-24 07:36
@bethskurrie thanks for the feedback! We use self-hosted broker indeed and I can give the edge version a shot.

mark.white
2020-11-24 09:03
has joined #pact-broker

matt.fellows
2020-11-24 13:16
@nerea.tamayo FYI see above

nerea.tamayo
2020-11-24 13:17
has joined #pact-broker

ufuk.ozcelik
2020-11-24 14:58
has joined #pact-broker

stefanos.varsanis
2020-11-24 16:48
has joined #pact-broker

lalexander2810
2020-11-24 16:53
has joined #pact-broker

stefanos.varsanis
2020-11-24 16:53
Hello fellow Pact lovers, I have a question regarding webhooks. I have created a webhook which works perfectly with each new content change I am not getting it to be triggered when a tag (even a totally new tag) is applied to the consumer pact. The webhook has the below configuration event ``` "events": [ { "name": "contract_content_changed" } ],``` Any ideas on how to debug this issue? Thank you in advance

sivaprasad9
2020-11-24 20:46
has joined #pact-broker

jarmy
2020-11-24 22:31
I _thought_ I had upgraded to `2.68.1.0` but I'm still seeing `"X-Pact-Broker-Version: 2.57.0\r\n"` when I publish to the broker. Where does the broker read this value from?

bethskurrie
2020-11-24 22:34
hm. Doesn't seem upgraded then.


bethskurrie
2020-11-24 22:35
It reads it from the PactBroker::VERSION constant

bethskurrie
2020-11-24 22:35
what constraints do you have that have made you choose that?

bethskurrie
2020-11-24 22:35
sounds like it needs a restart.

bethskurrie
2020-11-24 22:36
Can you explain the problem you're trying to solve @stefanos.varsanis?

jarmy
2020-11-24 22:37
It was on advice from our sysad team. Company policy forbids external images

bethskurrie
2020-11-24 22:37
:shrug::skin-tone-3:

bethskurrie
2020-11-24 22:37
What can you do!

jarmy
2020-11-24 22:37
my hands are tied

bethskurrie
2020-11-24 22:38
As long as the sysadmin team knows how to run a ruby app! We often get ppl with no dev ops experience trying to run the bare ruby app, and it all goes to shit.

bethskurrie
2020-11-24 22:38
But, it does sound like the server needs bouncing.

bethskurrie
2020-11-24 22:46
Also, here's the page on debugging webhooks https://docs.pact.io/pact_broker/webhooks/debugging_webhooks

jarmy
2020-11-24 22:49
bounced and it's still showing `2.57.0` on publish If you have the time, I'll jot down the high-level steps we use to build our image. Maybe you can spot where things are wrong?

bethskurrie
2020-11-24 22:50
Just double checking to make sure, but yes, the version is correct in the source code! https://github.com/pact-foundation/pact_broker/blob/v2.68.1/lib/pact_broker/version.rb

bethskurrie
2020-11-24 22:51
I can take a quick look.

jarmy
2020-11-24 23:03
1. add https://github.com/pact-foundation/pact-broker-docker/ as a submodule to our git repo 2. checkout the target release (e.g. `git checkout tags/2.68.1.0 -b 2.68.1.0`) 3. copy /pact-broker-docker/pact_broker/Gemfile & pact-broker-docker/pact_broker/Gemfile.lock into `ENV HOME=/pact_broker` 4. Run `bundle install --no-cache --deployment --without='development test'` 5. Then `cp -R pact-broker-docker/pact_broker/. "$HOME"` 6. Then start things up

bethskurrie
2020-11-24 23:04
submodules always kill me

bethskurrie
2020-11-24 23:05
Look in /pact_broker/lib/pact_broker/version.rb and see what's there.


bethskurrie
2020-11-24 23:07
oh, right. you'll have to look in the gem file

bethskurrie
2020-11-24 23:07
do 'gem env' and it will tell you where the gem directories are

jarmy
2020-11-24 23:10
I'm in a local pact-broker docker image right now and I'll I get is this: ```# gem env RubyGems Environment: - RUBYGEMS VERSION: 3.0.3 - RUBY VERSION: 2.6.5 (2019-10-01 patchlevel 114) [x86_64-linux] - INSTALLATION DIRECTORY: /usr/local/bundle - USER INSTALLATION DIRECTORY: /pact_broker/.gem/ruby/2.6.0 - RUBY EXECUTABLE: /usr/local/bin/ruby - GIT EXECUTABLE: - EXECUTABLE DIRECTORY: /usr/local/bundle/bin - SPEC CACHE DIRECTORY: /pact_broker/.gem/specs - SYSTEM CONFIGURATION DIRECTORY: /usr/local/etc - RUBYGEMS PLATFORMS: - ruby - x86_64-linux - GEM PATHS: - /usr/local/bundle - /pact_broker/.gem/ruby/2.6.0 - /usr/local/lib/ruby/gems/2.6.0 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :backtrace => false - :bulk_threshold => 1000 - "install" => "--no-document" - "update" => "--no-document" - REMOTE SOURCES: - https://rubygems.org/ - SHELL PATH: - /usr/local/bundle/bin - /usr/local/sbin - /usr/local/bin - /usr/sbin - /usr/bin - /sbin - /bin```

bethskurrie
2020-11-24 23:10
run "gem list" for me

jarmy
2020-11-24 23:14
```# gem list *** LOCAL GEMS *** bigdecimal (default: 1.4.1) bundler (2.0.2, default: 1.17.2) cmath (default: 1.0.0) csv (default: 3.0.9) date (default: 2.0.0) dbm (default: 1.0.0) did_you_mean (1.3.0) e2mmap (default: 0.1.0) etc (default: 1.0.1) fcntl (default: 1.0.0) fiddle (default: 1.0.0) fileutils (default: 1.1.0) forwardable (default: 1.2.0) gdbm (default: 2.0.0) io-console (default: 0.4.7) ipaddr (default: 1.2.2) irb (default: 1.0.0) json (default: 2.1.0) logger (default: 1.3.0) matrix (default: 0.1.0) minitest (5.11.3) mutex_m (default: 0.1.0) net-telnet (0.2.0) openssl (default: 2.1.2) ostruct (default: 0.1.0) power_assert (1.1.3) prime (default: 0.1.0) psych (default: 3.1.0) rake (12.3.2) rdoc (default: 6.1.2) rexml (default: 3.1.9) rss (default: 0.2.7) scanf (default: 1.0.0) sdbm (default: 1.0.0) shell (default: 0.7) stringio (default: 0.0.2) strscan (default: 1.0.0) sync (default: 0.5.0) test-unit (3.2.9) thwait (default: 0.1.0) tracer (default: 0.1.0) webrick (default: 1.4.2) xmlrpc (0.3.0) zlib (default: 1.0.0) # ```

bethskurrie
2020-11-24 23:40
ok.... the pact broker gem isn't there at all

bethskurrie
2020-11-24 23:40
try running `bundle list` from the home directory

jarmy
2020-11-24 23:41
if I run `cat Gemfile.lock` I see `pact_broker (2.68.1)`

bethskurrie
2020-11-24 23:41
that's a good start

jarmy
2020-11-24 23:42
ah, but my docker image shows `pact_broker (2.57.0)`. I think I'm on to something

bethskurrie
2020-11-24 23:42
running "gem list pact_broker" should show the version(s) that are installed

bethskurrie
2020-11-24 23:44
ok, if I run ```docker run --rm --entrypoint /bin/sh -it pactfoundation/pact-broker:2.68.1.0 $ bundle list ... pact_broker (2.68.1)```

bethskurrie
2020-11-24 23:46
WHen you run "bundle install" you should see the output of the gems its installing

jarmy
2020-11-25 00:15
I think I've figured it out. I failed to check in the submodule commit to my branch :exploding_head:

bethskurrie
2020-11-25 00:15
submodules

bethskurrie
2020-11-25 00:15
they are evil

jarmy
2020-11-25 00:15
especially when you don't use them frequently

jarmy
2020-11-25 00:16
time to update the README

bethskurrie
2020-11-25 00:16
mm. I use them about once a decade and have to relearn it over from scratch each time!

jarmy
2020-11-25 00:28
sigh. the container won't start up due this error ```bundler: failed to load command: puma (/pact_broker/vendor/bundle/ruby/2.6.0/bin/puma) TypeError: no implicit conversion of nil into String config/puma.rb:1:in `[]' config/puma.rb:1:in `_load_from' /pact_broker/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/lib/puma/dsl.rb:43:in `instance_eval' /pact_broker/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/lib/puma/dsl.rb:43:in `_load_from' /pact_broker/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/lib/puma/configuration.rb:194:in `block in load' /pact_broker/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/lib/puma/configuration.rb:194:in `each' /pact_broker/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/lib/puma/configuration.rb:194:in `load' /pact_broker/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/lib/puma/launcher.rb:61:in `initialize' /pact_broker/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/lib/puma/cli.rb:71:in `new' /pact_broker/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/lib/puma/cli.rb:71:in `initialize' /pact_broker/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/bin/puma:8:in `new' /pact_broker/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/bin/puma:8:in `<top (required)>' /pact_broker/vendor/bundle/ruby/2.6.0/bin/puma:23:in `load' /pact_broker/vendor/bundle/ruby/2.6.0/bin/puma:23:in `<top (required)>'```

bethskurrie
2020-11-25 00:28
might need RACK_ENV set to "production"

bethskurrie
2020-11-25 00:29
oh, nope

bethskurrie
2020-11-25 00:29
```port ENV[ENV['PACT_BROKER_PORT_ENVIRONMENT_VARIABLE_NAME']]```

bethskurrie
2020-11-25 00:29
```PACT_BROKER_PORT_ENVIRONMENT_VARIABLE_NAME``` should be set in the Dockerfile

bethskurrie
2020-11-25 00:30
I've seem someone else maintaining a "forked" dockerfile with a different appropach. Let me see if I can find it.

bethskurrie
2020-11-25 00:34
hm, no, can't find it.

bethskurrie
2020-11-25 00:34
You'd be better off forking the repo, and changing the base image.

bethskurrie
2020-11-25 00:34
at least that way, you'd get all the env vars that are supposed to be set in the Dockerfile


jarmy
2020-11-25 00:35
I'm sure there's a better way. I'm wedged in between our infrastructure and the broker

jarmy
2020-11-25 00:50
ok, i've got `2.68.1` running but pacts are still not getting tagged ``` <- "PUT /pacticipants/web/versions/fd292b0a/tags/task%2Ftest-pact-publish HTTP/1.1\r\nAccept: application/hal+json, application/json\r\nContent-Type: application/json\r\nContent-Length: 0\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nUser-Agent: Ruby\r\nConnection: close\r\nHost: http://stage.pact-broker.docker.savagebeast.com\r\n\r\n" <- "" -> "HTTP/1.1 404 Not Found\r\n"``` This is our staging env so I can delete pacts and start with a clean slate.

bethskurrie
2020-11-25 00:51
is it definitely the slash?

bethskurrie
2020-11-25 00:51
if you use a tag without a slash, it gets created?

jarmy
2020-11-25 00:52
let me try

bethskurrie
2020-11-25 00:53
I can't remember, did you manage to replicate the issue with the docker pact cli?

jarmy
2020-11-25 00:53
I gave it a shot but couldn't publish due to SSL cert error

bethskurrie
2020-11-25 00:53
I can show you how to fix that


bethskurrie
2020-11-25 00:54
Also, have you looked in the broker logs?

bethskurrie
2020-11-25 00:54
To see if it's rejecting it for some reason that's logged?

jarmy
2020-11-25 00:55
I looked yesterday but didn't see anything, i don't have debugging enabled in our prod environment, would that matter?

bethskurrie
2020-11-25 00:56
hm.

bethskurrie
2020-11-25 00:57
I wonder if it's hitting the invalid URI protection somehow.

bethskurrie
2020-11-25 00:57
```def call env if (uri = valid_uri?(env)) if (error_message = validate(uri)) [422, {'Content-Type' => 'text/plain'}, [error_message]] else app.call(env) end else [404, {}, []] end end```

bethskurrie
2020-11-25 00:57
Because the tag resource doesn't even have code that returns 404.

bethskurrie
2020-11-25 00:58
so, did the no slash tag work?


bethskurrie
2020-11-25 01:02
and what version of pact-node are you on?

jarmy
2020-11-25 01:03
10.11.0

bethskurrie
2020-11-25 01:03
if you run your docker image locally, and try to publish to it, do you have the same issue?

jarmy
2020-11-25 01:04
Here's the broker log for a pact I just created

jarmy
2020-11-25 01:04
```2020-11-24 17:01:27.754464 I [6:puma 001] pact-broker -- Creating new pact publication with params {:consumer_name=>"web", :provider_name=>"pegasus", :revision_number=>nil, :consumer_version_number=>"fd292b0a", :pact_version_sha=>nil, :consumer_name_in_pact=>"web", :provider_name_in_pact=>"pegasus"} 2020-11-24 17:01:27.754476 D [6:puma 001] pact-broker -- Content {"consumer":{"name":"web"},"provider":{"name":"pegasus"},"interactions":[{"description":"a request for v1/view","request":{"method":"GET","path":"/rest/v1/view","query":"deviceUuid=acctssp137-test-deviceUUID&platform=web"},"response":{"status":200,"headers":{"Content-Type":"application/json"},"body":{"sduiVersion":"1","itemId":"7NOr1za9vhlZp9exibwtxXdQK3QDNsN7eGVMhjeYgDJBDW6nxB5f9dHATjlKYfZ7D0B2cDFucbaj","page":{"itemId":"ockzpjWijfejTg0pwjyV0RFiizft3WhEpAYWIHKhNSXRr0KqqgCOzfUvkqKLiYd7cVXNjh7kiQQ7zXMHX4GKP7PxwZIKX","type":"CONTAINER","view":"PAGE","containers":[{"itemId":"ockzpjWijfejTg0pwjyV0RFiizft3WhEpAYWIHKhNWB99hhIDfC23yQ0eEsFPBqSOxYscP72XMCO2borHlEKkdHEnmn3R","type":"CONTAINER","component":"top-nav","view":"ELEMENT","items":[{"itemId":"1z9Mcwr2SqS92fH573GOr7mnJFP7K18BqkMCIH05uOwTvN3YdophadPi9YFPeAqt1seM124o2LO8f2ves5DSlUIVM3cQDVcza6cYBhSKREdzdE4bCiJ3nuNE09","type":"ITEM","component":"top-nav-item","texts":{"title":{"value":"Welcome! Content for you, updated daily"}},"images":{"icon":{"value":"ForYou","scheme":"BINDING"}},"actions":{"default":[{"context":"displayPage","type":"PRIMARY","intentType":"VIEW","intentId":"Xrad4ke8jrBX4jlYjOsiIVT8EkFieVwgIe1wJwRAkjKRJD9mS2UkLC8B2mQCob8xeA2NHojFkIYVXgHVj9DJFW7TwEHcS8032w4ImzCrhKcIJzjhahW1ByFwAqYj"},{"context":"selectItem","type":"PRIMARY","intentType":"LOCAL","intentId":"selectItem"}]}},{"itemId":"7Dqk3iSKdsBo399FwHyizxa9ciZQ9WC87A1kznDZFX1OlsUYIs1kY0yQFnjdAjyt49bqlztqBZVDFeVfeEwdCpN4sSurYGmpRFLzWDpwPqF6wrGNqWsLTQn","type":"ITEM","component":"top-nav-item","texts":{"title":{"value":"New & Now"}},"images":{"icon":{"value":"live","scheme":"BINDING"}},"actions":{"default":[{"context":"displayPage","type":"PRIMARY","intentType":"VIEW","intentId":"1M8OQZAFZPTa9nmtiEeDL4VOBJKr8fldcEp66ykiIptqaHDTilUB50Nvm8mXtTGafQWvKlFs176gzeqZEFaChAivUbEsXZRnPIZcjeleAQcq2j"},{"context":"selectItem","type":"PRIMARY","intentType":"LOCAL","intentId":"selectItem"}]}},{"itemId":"1z9Mcwr2SqS92fH573GOr7mnJFP7K18BqkMCIH05uOwTvN3YdophadPi9YFPfMbIESUaCPR5iLfue475w8RmEjRjAJ5ilxcr9E6OG05YqHOPcPECxNhYvSMehl","type":"ITEM","component":"top-nav-item","texts":{"title":{"value":"Search"}},"images":{"icon":{"value":"Search","scheme":"BINDING"}},"actions":{"default":[{"context":"displayPage","type":"PRIMARY","intentType":"VIEW","intentId":"2FpHFLcbk5LbcZYyNPSjuuPwI0syuNHuIezI0oLICOxAOlKKO3mIxLW5lbTwCuvN0HpRo9ZSs72ryUOThXbuW28bU8wFffxBWx9WSsn4S6eapSlfYW1XrMld96FNFZ"},{"context":"selectItem","type":"PRIMARY","intentType":"LOCAL","intentId":"selectItem"}]}},{"itemId":"8CUfQp10B6aDL0QX77TidM9TbTbiEefovnPelSCOOszTYtCh2PtTzGkAJRPc5bpg2sJuaWLSxN6ez8HxXX7NDhu6EL3Ip1Bro3qTqyENAzmqXOi6iBtA7pmXifp","type":"ITEM","component":"top-nav-item","texts":{"title":{"value":"My Stuff"}},"images":{"icon":{"value":"MyStuff","scheme":"BINDING"}},"actions":{"default":[{"context":"displayPage","type":"PRIMARY","intentType":"VIEW","intentId":"1kSkzvkZzy6jXhO2PFyinsdGrSEOFroPDMHrWOztWKz9J7CSXY9f4ri0oJHo8hHYK0OhUyNC03VITIqGZKKNJ81FMx1EX0DliEIeIGzCsSZnCMnjqlGJbt"},{"context":"selectItem","type":"PRIMARY","intentType":"LOCAL","intentId":"selectItem"}]}}]}]}},"matchingRules":{"$.body.itemId":{"match":"type"},"$.body.page.itemId":{"match":"type"},"$.body.page.containers[0].itemId":{"match":"type"},"$.body.page.containers[0].items[0].itemId":{"match":"type"},"$.body.page.containers[0].items[0].texts.title.value":{"match":"type"},"$.body.page.containers[0].items[0].images.icon.value":{"match":"type"},"$.body.page.containers[0].items[0].actions.default[0].intentId":{"match":"type"},"$.body.page.containers[0].items[0].actions.default[1].context":{"match":"type"},"$.body.page.containers[0].items[0].actions.default[1].intentId":{"match":"type"},"$.body.page.containers[0].items[1].itemId":{"match":"type"},"$.body.page.containers[0].items[1].texts.title.value":{"match":"type"},"$.body.page.containers[0].items[1].images.icon.value":{"match":"type"},"$.body.page.containers[0].items[1].actions.default[0].intentId":{"match":"type"},"$.body.page.containers[0].items[1].actions.default[1].context":{"match":"type"},"$.body.page.containers[0].items[1].actions.default[1].intentId":{"match":"type"},"$.body.page.containers[0].items[2].itemId":{"match":"type"},"$.body.page.containers[0].items[2].texts.title.value":{"match":"type"},"$.body.page.containers[0].items[2].images.icon.value":{"match":"type"},"$.body.page.containers[0].items[2].images.icon.scheme":{"match":"type"},"$.body.page.containers[0].items[2].actions.default[0].context":{"match":"type"},"$.body.page.containers[0].items[2].actions.default[0].intentId":{"match":"type"},"$.body.page.containers[0].items[2].actions.default[1].context":{"match":"type"},"$.body.page.containers[0].items[2].actions.default[1].intentId":{"match":"type"},"$.body.page.containers[0].items[3].itemId":{"match":"type"},"$.body.page.containers[0].items[3].texts.title.value":{"match":"type"},"$.body.page.containers[0].items[3].images.icon.value":{"match":"type"},"$.body.page.containers[0].items[3].actions.default[0].intentId":{"match":"type"},"$.body.page.containers[0].items[3].actions.default[1].context":{"match":"type"},"$.body.page.containers[0].items[3].actions.default[1].intentId":{"match":"type"}}}}],"metadata":{"pactSpecification":{"version":"2.0.0"}}}```

bethskurrie
2020-11-25 01:05
you're hardcoding the tag with the slash aren't you? Not getting from the `git` command?

bethskurrie
2020-11-25 01:05
We see issues when there are extra characters at the front or back of a string from the terminal.

jarmy
2020-11-25 01:06
I _am_ hardcoding it at the moment `tags: 'task/test-pact-publish'`

bethskurrie
2020-11-25 01:07
ok, so what happens when you run your instance locally and publish to it?

jarmy
2020-11-25 01:07
same thing: no tag

bethskurrie
2020-11-25 01:07
ok, if you run the OSS one locally, what happens?

bethskurrie
2020-11-25 01:08
I feel like there's something in the middle between the client and the broker that's doing something to the request.

bethskurrie
2020-11-25 01:09
can you change your build to modify the puma file

bethskurrie
2020-11-25 01:10
add `log_requests` to it anywhere

bethskurrie
2020-11-25 01:12
echo "log_requests" >> /$HOME/config/puma.rb

bethskurrie
2020-11-25 01:12
in the dockerfile

bethskurrie
2020-11-25 01:16
@mateusz.derks I've released 2.69.0.0

bethskurrie
2020-11-25 01:17
If you set the env var `PACT_BROKER_FEATURES=experimental_webhook_wip` then it will append "wip=true" to the metadata.

bethskurrie
2020-11-25 01:17
Let me know how it goes, and if we like it, and there are no problems, I'll keep the feature without the flag.

jarmy
2020-11-25 01:20
oh, I have nginx running. would that interfere? > I feel like there's something in the middle between the client and the broker that's doing something to the request

bethskurrie
2020-11-25 01:20
it might

bethskurrie
2020-11-25 01:20
not sure about ngnix and puma together

bethskurrie
2020-11-25 01:20
they might fight each other.

bethskurrie
2020-11-25 01:21
if you want to use ngnix, then you should probably copy the dius image


jarmy
2020-11-25 01:22
hmm. that changes things.

bethskurrie
2020-11-25 01:22
the puma logging I described above should show you if the request path is being modified at all on the way through.


jarmy
2020-11-25 01:23
i needed to turn off ```PACT_BROKER_SQL_LOG_LEVEL```

bethskurrie
2020-11-25 01:25
Looks like it's ngnix's fault. You don't need it if you're running with a load balancer in a docker managed environment like kubernetes, or ECS.

bethskurrie
2020-11-25 01:26
and puma

jarmy
2020-11-25 01:27
I was advised to use it to set up the broker on SSL

jarmy
2020-11-25 01:36
here's the output from the broker when I tried to publish with the tag after adding `RUN echo "log_requests" >> /$HOME/config/puma.rb` to the Dockerfile ```169.253.0.4 - - [24/Nov/2020:17:28:05 -0800] "PUT /pacticipants/web/versions/fd292b0a/tags/task/test-pact-publish HTTP/1.0" 404 - 0.6167 2020-11-24 17:28:05.933768 I [6:puma 001] pact-broker -- Creating new pact publication with params {:consumer_name=>"web", :provider_name=>"pegasus", :revision_number=>nil, :consumer_version_number=>"fd292b0a", :pact_version_sha=>nil, :consumer_name_in_pact=>"web", :provider_name_in_pact=>"pegasus"}```

bethskurrie
2020-11-25 02:06
You can use puma with SSL


bethskurrie
2020-11-25 02:08
Well that's definitely the issue! "/tags/task/test-pact-publish"

bethskurrie
2020-11-25 06:05
@antonello @jarmy @mateusz.derks @phil.endsley @bret.mcclory and anyone else using WIP pacts. Do you find there is benefit to having WIP pacts enabled on feature branches of your provider? I've recently updated the "best practise" recommendation to only enable it on the "main" development branches, because I figure, if you're making a branch for a non-pact related change, you don't care about WIP pacts, and if you are making a branch for a pact related change, then you probably know which pact you're working on, and can either use a matching feature branch strategy, or temporarily modify the config to pull in the one you want. What is your experience? I'm asking because I'm trying to fix an issue in the initial phase of "getting it all working" that Phil has raised, and if I change a certain piece of logic, it would have an impact on how WIP pacts are calculated when a brand new branch of the provider is created.

ashish_garg5
2020-11-25 06:10
Hi All, I am using dius/pact-broker docker image. I changed the image version from 3 to 2 and see some data loss. Not sure if this data loss happens because of version change or stopping the container. Can anyone please help what could be the reason so that i can avoid this in future ? Thanks

bethskurrie
2020-11-25 06:12
You need an external database

bethskurrie
2020-11-25 06:13
Please provide complete details of your set up.

bethskurrie
2020-11-25 06:14
Upgrading does not wipe your data, so I would guess that you used a database volume that was destroyed when you shut down your broker container.

ashish_garg5
2020-11-25 06:15
yeah i am using an external database but somehow data is not there now in my db.

bethskurrie
2020-11-25 06:53
How are you running your broker? Locally, or to a deployed env? Where is the database running? For us to help you, we need to understand your full set up. Put yourselves in our position and try to give us enough information to be able to give you a helpful answer.

antonello
2020-11-25 07:01
We don?t use WIP pacts :sweat_smile:

matt.fellows
2020-11-25 07:33
Did you say you?ve *downgraded* your pact broker version? Did you back up the database before doing that?

stefanos.varsanis
2020-11-25 07:51
Hey, what we're doing is when we have a release, we're "promoting" the developer tags to Release tags, thus, when a pact is marked with Release tag we want the verifications to be trigerred by the webhook

mateusz.derks
2020-11-25 07:58
We want to use WIP pacts to prevent missing verifications when a provider/consumer is released. The issue we had was that once a new version was released it invalidated all release candidates for other pacticipants because they were verified against another (the old) production. Having WIP pacts enabled on our main branch is all we need. When we have feature branches of the provider we use matching feature as you said.

mateusz.derks
2020-11-25 08:01
Thanks a lot @bethskurrie ! I will play with :+1:

ashish_garg5
2020-11-25 09:49
@bethskurrie I am using some VM where i have pulled this docker image... so my docker-compose looks like this- version: "3" services: pact-broker: image: dius/pact-broker environment: PACT_BROKER_DATABASE_USERNAME: pact_broker PACT_BROKER_DATABASE_PASSWORD: pact_broker PACT_BROKER_DATABASE_HOST: <http://uvxpgsdev01.isus.emc.com|<>external_stg_server> PACT_BROKER_DATABASE_NAME: pact_broker PACT_BROKER_LOG_LEVEL: INFO PACT_BROKER_BASIC_AUTH_USERNAME: <username> PACT_BROKER_BASIC_AUTH_PASSWORD: <password> PACT_BROKER_ALLOW_PUBLIC_READ: "true" ports: - "8500:80"

ashish_garg5
2020-11-25 09:50
now in this i downgraded my version from 3 to 2

matt.fellows
2020-11-25 10:29
Which version? Docker compose?

matt.fellows
2020-11-25 10:29
And also why?

matt.fellows
2020-11-25 10:30
What do the logs say?

ashish_garg5
2020-11-25 10:32
so i have provided basic auth but still i was able to delete contracts from pact broker by using curl command...and i also have 1 more pact broker running with same config but having version 2 and there i was not able to delete without passing creds. So just to make it as like the other 1 i downgraded it to 2.

matt.fellows
2020-11-25 11:51
so this all sounds a lot like your docker compose setup isn?t correct.

matt.fellows
2020-11-25 11:51
downgrading docker compose has nothing to do with the application it?s running - they are separate things

matt.fellows
2020-11-25 11:51
you mentioned data is lost?

ashish_garg5
2020-11-25 12:01
yes

matt.fellows
2020-11-25 12:24
what data

ashish_garg5
2020-11-25 12:25
there were around 30 contracts in pact broker and after doing this now i can see only 10

matt.fellows
2020-11-25 12:25
that?s? strange. I can?t see how that?s related

matt.fellows
2020-11-25 12:25
the data is the data

matt.fellows
2020-11-25 12:26
unless you?ve pointed at a different database or something, that makes no sense to me

matt.fellows
2020-11-25 12:26
I?m currently leaning towards a docker configuration issue. If you can provide an example repro that shows the before/after and pinpoint it to pact code, I?m sorry but you may need to work with your ops team to perform forensics on the change (look at logs, restore backups etc.)

ashish_garg5
2020-11-25 12:27
yeah it's very strange not sure what is the reason, even i tried replicating this but this time no data loss all contracts are there.

ashish_garg5
2020-11-25 12:27
sure np... thanks

matt.fellows
2020-11-25 12:28
np

matt.fellows
2020-11-25 12:28
if you work it out, let us know - strange

ashish_garg5
2020-11-25 12:29
sure

phil.endsley
2020-11-25 14:09
We have wip pacts enabled for feature branches, but it's mainly just for simplicity in our CI setup. I don't think we really get any benefit out of verifying wip pacts on feature branches, and we haven't seen any adverse side effects from doing it this way > or temporarily modify the config to pull in the one you want This is what we do, since our naming conventions and other integrations prevent us from matching branch names. It's a little tedious, but it works

scyr
2020-11-25 14:56
has joined #pact-broker

bethskurrie
2020-11-25 21:57
> We don?t use WIP pacts Yeah, I didn't think you did @antonello, but I'd seen you reply to someone's question about WIP pacts so expertly that I wondered if you had!

antonello
2020-11-25 21:58
I just love all features equally ?

antonello
2020-11-25 21:58
Whether I use them or not.

bethskurrie
2020-11-25 21:59
I swear, you're the number 2 expert on how it works, despite not being a Ruby developer!

antonello
2020-11-25 22:08
I made a PR last year. Does that make me a ruby developer?:rolling_on_the_floor_laughing:

timotheus.ruprecht
2020-11-25 22:12
has joined #pact-broker

bethskurrie
2020-11-25 22:47
I reckon!

guppy0356.nakira
2020-11-26 06:24
Should I add contracts to the git index?

borsuk.artem034
2020-11-26 09:22
if you have pact-broker, not add contract files in git

yann.courtel
2020-11-26 09:27
You should only have the code that creates / update your contract on the consumer side and the one validating the contract on the provider side in your source control. Only save your pact files in your source control if you don't have a pact broker.

abubics
2020-11-26 11:01
I'd say, even if you don't have a broker, don't put it in git. The contract is a product of both the consumer and the provider, not belonging solely to either :slightly_smiling_face:

manali.mogre
2020-11-26 11:44
has joined #pact-broker

erik.terpstra
2020-11-26 12:08
has joined #pact-broker

guppy0356.nakira
2020-11-26 14:30
Thank you for your respond :smile:

mateusz.derks
2020-11-26 20:16
I can?t get it working. The contract URL contains correct metadata param when I enable the flag, but it still unmarks the contract as WIP. In the broker logs I see that two verifications are created, looks suspicious as once it?s created with `wip: false` ```pact-broker_1 | 2020-11-26 20:05:56.042501 I [7:puma 002] pact-broker -- Fetching pacts for verification by Provider -- {:provider_name=>"Provider", :params=>{"providerVersionTags"=>["main"]}} pact-broker_1 | 2020-11-26 20:05:56.194874 I [7:puma 002] pact-broker -- Creating verification 275 for pact_id=59 -- {"success"=>true, "providerApplicationVersion"=>"277cb844feb687ebf378da45e4d000aeb9fa4e73", "wip"=>false} pact-broker_1 | 2020-11-26 20:05:56.280104 I [7:puma 002] pact-broker -- Creating verification 276 for pact_id=59 -- {"success"=>true, "providerApplicationVersion"=>"277cb844feb687ebf378da45e4d000aeb9fa4e73", "wip"=>true}``` those are the settings I use for a verification by URL: ```let opts = { providerBaseUrl: 'some URL', provider: 'Provider', pactBrokerUrl: 'some URL', publishVerificationResult: true, providerVersion: gitSha, providerVersionTags: ['main'], pactUrls: ['url from the webhook'] }``` any idea why the broker creates two verifications in such case? Looks like the second verification does works as expected, but it is cancelled out by the first one.

mateusz.derks
2020-11-26 20:25
I can try with a ruby gem, maybe it is specific problem with pact-js

kjayachandra2000
2020-11-26 20:40
has joined #pact-broker

mateusz.derks
2020-11-26 20:45
Ok, I don?t need to pass `pactBrokerUrl: 'some URL',` in case I use `pactUrls` , works like a charm now :yay:

mateusz.derks
2020-11-26 20:53
@bethskurrie thank you :taco: I hope you like this feature and there are no objections from having it enabled without a flag

tjones
2020-11-26 22:44
I agree with @abubics - I would avoid committing the contract into source control, even without a broker. I think committing it is likely to cause workflow frustrations. However, you do need a way to share the contract with the provider verification test - options include deploying the contract somewhere as part of the build, and running the provider verification test as part of your consumer build. It is _much_ easier with a broker, though.

abubics
2020-11-26 22:54
Absolutely what @tjones said :D We've survived with saving a shared contact file in S3 temporarily, but the broker is definitely best.

sushil.kumar
2020-11-27 01:45
has joined #pact-broker

wilkinsweiqiangliang
2020-11-27 05:40
#pact-broker Hey guys, i receive error on docker version of `pact-cli` .

wilkinsweiqiangliang
2020-11-27 05:40
```Error making request - Errno::ENOENT No such file or directory @ rb_sysopen```

bethskurrie
2020-11-27 05:40
Please provide all the information that we might need to help you debug that problem.

wilkinsweiqiangliang
2020-11-27 05:40
I had run my build three time, got this issue for the previous two time, and doesnt have this error on the third retry

wilkinsweiqiangliang
2020-11-27 05:41
what information do you need? i can ping you in direct chat

bethskurrie
2020-11-27 05:41
No direct chats please


bethskurrie
2020-11-27 05:41
Please read this.

wilkinsweiqiangliang
2020-11-27 05:41
cool

bethskurrie
2020-11-27 05:42
Think what information you would want if someone was asking you to help.

wilkinsweiqiangliang
2020-11-27 05:49
sure

wilkinsweiqiangliang
2020-11-27 05:49
the way i run it. `"docker run --rm -v ${PWD}:${PWD} -e PACT_BROKER_BASE_URL -e PACT_BROKER_TOKEN pactfoundation/pact-cli:latest broker publish ${PWD}/pacts --consumer-app-version=${BUILDKITE_COMMIT} --tag=${BUILDKITE_BRANCH}"`

wilkinsweiqiangliang
2020-11-27 05:51
```Error making request - Errno::ENOENT No such file or directory @ rb_sysopen - /var/lib/buildkite-agent/builds/buildkite-deployers-general-management-i-00437c6a99af63bdf-4/my-company/my-project/pacts /usr/lib/ruby/gems/2.7.0/gems/pact_broker-client-1.34.0/lib/pact_broker/client/pact_file.rb:32:in `read', attempt 1 of 3 Error making request - Errno::ENOENT No such file or directory @ rb_sysopen - /var/lib/buildkite-agent/builds/buildkite-deployers-general-management-i-00437c6a99af63bdf-4/my-company/my-project/pacts /usr/lib/ruby/gems/2.7.0/gems/pact_broker-client-1.34.0/lib/pact_broker/client/pact_file.rb:32:in `read', attempt 2 of 3 Error making request - Errno::ENOENT No such file or directory @ rb_sysopen - /var/lib/buildkite-agent/builds/buildkite-deployers-general-management-i-00437c6a99af63bdf-4/my-company/my-project/pacts /usr/lib/ruby/gems/2.7.0/gems/pact_broker-client-1.34.0/lib/pact_broker/client/pact_file.rb:32:in `read', attempt 3 of 3 Failed to tag version due to error: Errno::ENOENT - No such file or directory @ rb_sysopen - /var/lib/buildkite-agent/builds/buildkite-deployers-general-management-i-00437c6a99af63bdf-4/my-company/my-project/pacts```

bethskurrie
2020-11-27 05:51
It looks fine to me. I usually see that error `Errno::ENOENT No such file or directory @ rb_sysopen` when there is something slightly wrong with the publish command, and it has a problem parsing the command and things that one of the strings you've passed in is a directory or file.

wilkinsweiqiangliang
2020-11-27 05:52
it worried me, the third time i retry my build step, it passed

bethskurrie
2020-11-27 05:52
Do an "ls" on the pacts directory before you run the command, to make sure the files are actually where you think they are

wilkinsweiqiangliang
2020-11-27 05:53
:+1:

bethskurrie
2020-11-27 05:53
and put a +x on the script so you can see exactly what the final command is

wilkinsweiqiangliang
2020-11-27 05:54
cool, let me run the debug on script

zhujian
2020-11-27 07:54
has joined #pact-broker

guppy0356.nakira
2020-11-27 09:12
Can I deploy pact-broker in AWS? Is it possible to connect RDS?

bethskurrie
2020-11-27 09:12
Yes. That's how Pactflow runs.

bethskurrie
2020-11-27 09:12
No, we don't have an OSS Cloudformation template for it.

bethskurrie
2020-11-27 09:13
You can get an idea of the system requirements from the Pactflow on-prem requirements though


guppy0356.nakira
2020-11-27 09:15
Thank you for your respond!! I will create CloudFormation template.

guppy0356.nakira
2020-11-27 09:17
`pact-broker-docker` is for local development, isn't it? It is not for Task Definition in AWS.

bethskurrie
2020-11-27 09:17
I don't understand the question

guppy0356.nakira
2020-11-27 09:19
Your organization have pact-broker and pact-broker-docker, don't you? It seems pact-broker-docker is for AWS template.

bethskurrie
2020-11-27 09:19
Which organisation in which platform has what named pact-broker and pact-broker-docker?

bethskurrie
2020-11-27 09:20
I think you're asking which docker image to run on AWS.



guppy0356.nakira
2020-11-27 09:23
Sorry for the confusion.

bethskurrie
2020-11-27 09:24
I'm sorry I don't speak another language fluently :wink:

h.octavian
2020-11-27 14:08
has joined #pact-broker

guppy0356.nakira
2020-11-28 11:36
Anonymous user can delete contract in Broker. Is my understanding correct?

bethskurrie
2020-11-28 19:26
That should not be possible if you have correctly configured the basic auth @guppy0356.nakira

bethskurrie
2020-11-28 19:27
Can you please share the environment variables you have used to configure your broker.

noel
2020-11-28 23:12
has joined #pact-broker

guppy0356.nakira
2020-11-30 00:21
I don't know if I can express it well. I don't configure environment variables. I restrict access to broker by using security group. So, anyone who can access it can delete contract.

guppy0356.nakira
2020-11-30 00:28
What I mean is broker don't have user permissions. All users can read / update / delete contract. Is it correct?@bethskurrie

muraalee
2020-11-30 01:56
has joined #pact-broker

pooja.sharma
2020-11-30 08:52
has joined #pact-broker

mo
2020-11-30 09:24
has joined #pact-broker

aliaksandr.valadzko
2020-11-30 15:50
Hey guys I have a question regarding PACT _federation_ or something like this In our company we have huge amount of teams, which develop their own bunch of microservices. At this point we add PACT testing within our team's microservices. However we also want to provide to other teams (our consumers) ability to send PACT contracts to our broker. So my question is, how this situation should be handled - does every team should have its own PACT broker service, or there should be one _Godlike_ PACT broker service which should be shared across teams, or there is some mechanism to connect PACT broker services? Thanks!

phil.endsley
2020-11-30 15:58
Are you using OSS broker, or Pactflow? If it's all within the same organization, I would recommend a single broker. I think this makes things way easier. But you could have valid reasons for wanting separate instances. What are your reservations (if any) for having only a single instance?

aliaksandr.valadzko
2020-11-30 16:01
We deployed `dius/pact-broker` in our AWS infrastructure

phil.endsley
2020-11-30 16:04
We have the same sort of setup you're describing. ? Single OSS broker deployed in our cloud environment ? Every team within our org publishes to the same instance Most of the time, pacts are used within the same products, but occasionally, we integrate between other divisions/business units/whatever you want to call them. We haven't had any issues so far

aliaksandr.valadzko
2020-11-30 16:10
Thanks a lot, Phil! Quick follow up question: Do you know, is there a chance to _merge several_ PACT broker services (if we'll face this situation in future) ? Assume this could be done in BD layer, correct?

phil.endsley
2020-11-30 16:13
No idea, sorry :slightly_smiling_face: Will have to wait for @bethskurrie or someone else to weigh in on that

aliaksandr.valadzko
2020-11-30 16:15
Fair enough:joy: Just a hypothetical question, if at one day we'll understand that some other team in company has its own PACT broker and we'll decide to move contracts to some common place Thanks

david.greene
2020-11-30 21:47
has joined #pact-broker

jarmy
2020-11-30 22:32
we're only using WIP/Pending on main branches

bethskurrie
2020-11-30 22:33
cool

bethskurrie
2020-11-30 22:43
@aliaksandr.valadzko I'm not sure how you'd do a db merge at the db level because the ids would all conflict. It wouldn't be too hard to iterate over the important data via the API and copy it over though.

bethskurrie
2020-11-30 22:44
The OSS broker doesn't have any mechanism for grouping people or applications, however, we've just recently added team support to Pactflow, and it is available as an on premise application now

bethskurrie
2020-11-30 22:44
Here's a description of the teams+roles+permissions feature https://pactflow.io/blog/teams-roles-and-permissions/

bethskurrie
2020-11-30 22:46
Yes @guppy0356.nakira. There are no permissions in the OSS Pact Broker.

bethskurrie
2020-11-30 22:46
If you have configured your own authentication, then you are responsible for also configuring who can delete.

bethskurrie
2020-11-30 22:47
If you use the basic auth users provided in the docker application, there is a read/write user (they can delete) and a read only user (they can't delete).

bethskurrie
2020-11-30 22:48
In Pactflow, there are roles/teams/permissions however https://pactflow.io/blog/teams-roles-and-permissions/

guppy0356.nakira
2020-12-01 00:33
@bethskurrie Thank you for your respond :smile: > If you use the basic auth users provided in the docker application, there is a read/write user (they can delete) and a read only user (they can't delete). Umm, what is `users provided in the docker application` ? :thinking_face:


guppy0356.nakira
2020-12-01 00:39
Wow :astonished: Should `PACT_BROKER_BASIC_AUTH_USERNAME` and `PACT_BROKER_BASIC_AUTH_READ_ONLY_USERNAME` have different names?

bethskurrie
2020-12-01 00:40
yes

guppy0356.nakira
2020-12-01 00:48
```Pact.service_provider "My Service Provider" do honours_pacts_from_pact_broker do pact_broker_base_url 'http://...', {username: ENV['USER'], password: ENV['PASSWD'], token: '...'} end end``` For example `USER` equals `PACT_BROKER_BASIC_AUTH_USERNAME` in local development and `USER` equals `PACT_BROKER_BASIC_AUTH_READ_ONLY_USERNAME` ?

guppy0356.nakira
2020-12-01 00:48
BTW, What is `token` ?

bethskurrie
2020-12-01 00:48
Tokens are only used with Pactflow.

bethskurrie
2020-12-01 00:48
You set the user and password to whatever you want.

bethskurrie
2020-12-01 00:49
PACT_BROKER_BASIC_AUTH_USERNAME="pact-broker-ci" PACT_BROKER_BASIC_AUTH_READ_ONLY_USERNAME="pact-broker-dev" Those are options

bethskurrie
2020-12-01 00:50
You give the read only credentials to developers, and use the read/write credentials for CI.

aliaksandr.valadzko
2020-12-01 05:24
Thanks, Beth!

guppy0356.nakira
2020-12-01 06:18
When `ENV["GIT_BRANCH"]` is blank, is target consumer version `'main'` ? ```Pact.service_provider "Your provider" do honours_pacts_from_pact_broker do pact_broker_base_url "..." consumer_version_selectors [ { tag: ENV["GIT_BRANCH"], fallback_tag: "main", latest: true } ] end end```

guppy0356.nakira
2020-12-01 06:20
I got erros :cry: ```{"errors":{"consumerVersionSelectors":["tag can't be blank at index 0"]}} (Pact::Hal::ErrorResponseReturned)```

bas
2020-12-01 09:00
has joined #pact-broker

wainstead
2020-12-01 14:57
has joined #pact-broker

bethskurrie
2020-12-01 20:00
I think you've answered your own question.

bethskurrie
2020-12-01 20:02
The fallback tag is for when there is no pact for the given tag, not for when you've made a mistake in the configuration.

jerobinson
2020-12-01 20:32
has joined #pact-broker

bethskurrie
2020-12-02 00:14
@jarmy did you fix your ngnix issue?

bethskurrie
2020-12-02 00:15
@mateusz.derks that's great to hear. I'll enable this without the feature flag now.

jarmy
2020-12-02 00:15
Not yet. It's on my to-do list.

matt.fellows
2020-12-02 02:54
Also - thanks so much for the donation!!

matt.fellows
2020-12-02 02:54
:pray:

sumedhagamage
2020-12-02 03:33
has joined #pact-broker

guppy0356.nakira
2020-12-02 03:40
I think `main` branch doesn't exist. @bethskurrie BTW, following code is have same? ```Pact.service_provider "Your provider" do honours_pacts_from_pact_broker do pact_broker_base_url "..." consumer_version_selectors [ { tag: ENV["GIT_BRANCH"] || 'master', latest: true } ] end end```

mateusz.derks
2020-12-02 07:50
@bethskurrie amazing, can?t wait to see WIP tags fully working on our side :crossed_fingers: @matt.fellows I don?t want to think how much time you guys spent on answering my questions :smile: I appreciate all your support

fealaer
2020-12-02 11:40
has joined #pact-broker

kjayachandra2000
2020-12-02 14:15
Hi All, I am using the docker compose file to start the pact broker, how can i configure pactBrokerToken?

patrick.hendron
2020-12-02 14:44
has joined #pact-broker

stefanos.varsanis
2020-12-02 14:52
Hello, I have noticed the below behaviour in the `pending pacts` , please verify if this is the intended hehaviour. ? When a pact with provider tag `example` is verified by the provider then: the next time the provider test runs the pact will not be pending. ? If the provider tag `example` however is deleted , re-assigned and the tests are executed then the pact is still in pending state (even if actually is the same pact with the same content and provider tag). Should this be the case? Thanks

lpratt
2020-12-02 18:19
has joined #pact-broker

bethskurrie
2020-12-02 23:13
Are you using wip pacts, was it verified as a wip pact or was it explicit in the selectors and are you on the very latest version of the broker? @stefanos.varsanis

bethskurrie
2020-12-02 23:14
What do you mean by reassigned?

bethskurrie
2020-12-02 23:14
Are you deleting the tag or the version?

bethskurrie
2020-12-02 23:14
Could you give me the curl statements to reproduce?

bethskurrie
2020-12-02 23:16
Or use the fluent api and docker image described here https://github.com/pact-foundation/pact_broker/blob/master/ISSUES.md

bethskurrie
2020-12-02 23:17
The token is only used for Pactflow @kjayachandra2000

bethskurrie
2020-12-02 23:17
The OSS broker only supports basic auth.

bethskurrie
2020-12-02 23:17
No.

bethskurrie
2020-12-02 23:18
The first example checks on the server side if a pact with the given tag exists.

bethskurrie
2020-12-02 23:18
The second example checks if the env var GIT_BRANCH is set.

guppy0356.nakira
2020-12-03 00:27
@bethskurrie > The first example checks on the server side if a pact with the given tag exists. What does `the server` mean? It means Pact Broker?

kjayachandra2000
2020-12-03 07:44
thanks Beth :thumbsup:

stefanos.varsanis
2020-12-03 10:10
Hi @bethskurrie I was meant to use the Pending Pacts functionality which my broker is updated to use, not sure if accidently I am using the WIP. Let me describe the flow I am doing. 1. For a given pact: On a feature branch I execute the tests and push the verifications (this is in pending state, the build doesn't fail but the results are published) 2. I tag the provider with the branch name ( I do this to target the pact with the can-i-deploy) 3. I ask can-i-deploy to check if everything is ok in order to merge to master (As far as I understand I can also use the provider version instead of the tag from step 2) 4. I delete the feature branch tag from the provider 5. Once merged on master I do the same: execute the tests and publish the results (at this point it is still pending for master but the results are published) 6. I tag the provider pact with master and execute can-i-deploy (again I could use the provider version rather the tag (?) - using docker command `broker create-version-tag --pacticipant providerServiceName --version ${bamboo.maven.version} --tag ${bamboo.repository.git.branch} -b BROKER_URL` ) 7. Execute the can-I-deploy `broker can-i-deploy --pacticipant providerServiceName --version ${bamboo.maven.version} -b BROKER_URL` 8. Delete the tag `master` from the provider pact 9. Now every time I run the master again with the above flow it is re-tagged and the test is in pending state. 10. If I do not delete the pact in the final step(8) the next time I execute the tests they are considered normal tests and not pending. Of course I am only *testing out various workflows* so if you have anything to suggest please provide me with your insights. Thanks in advance

sandragnzalez
2020-12-03 11:04
has joined #pact-broker

sandragnzalez
2020-12-03 11:09
Hi All, I'd like to drop the Pact file in a remote machine, how should I configure PactDir property in c# ?

kristian
2020-12-03 14:34
has joined #pact-broker

kristian
2020-12-03 15:42
Hello. I'm all new to Pact and CDC and trying to get my head around it. Are there times when a pact broker would be overkill? For example if you have your consumer and provider services in a mono repo wouldn't it be easier just to have your pacts in a folder in your git repository that both services have access to?

elliottmurray
2020-12-03 17:14
So YMMV but certainly with a mono repo you can do this. I'd say to start with this is feasible but as you look at more sophisticated CI/CD work flows and you grow more comfortable around Pact you'll probably see the need yourself for something like Pact Broker.

antonello
2020-12-03 17:16
provided that consumer and provider are deployed at the same time, then you?re right - using the broker might be a bit of an overkill

phil.endsley
2020-12-03 19:16
I have a webhook question. It seems like a common use case is to configure a webhook for `contract_content_changed` to kick off provider verification. This way, pacts are verified as soon as they're published. But, if we create a new feature branch, it's still fired even if we aren't changing the pact. This is because the tag changes, and is working as intended (right?). For cases where the pact doesn't change, the pact is already pre-verified. The web hook is still triggered. Which makes sense when using web hooks for non build triggering actions. Is there a way to get the webhook fired only if a pact needs to be verified? This way, builds/verifications only run if they need to? I realize we can use can-i-deploy before running it to check if we need to run verifications, but this seems like something that would be so common it should be a first class feature. Or am I missing another way to do this?

antonello
2020-12-03 19:31
I think I might be guilty/responsible of this.


antonello
2020-12-03 19:31
I?m trying to reverse engineer my thinking :grimacing:

phil.endsley
2020-12-03 19:32
I'll try as well

phil.endsley
2020-12-03 19:38
> However, when you merge your feature branch into `master`, the webhook won't be triggered because the content of the pact won't have changed. This is not ideal because it would prevent you from triggering a verification against the provider's `master` branch. If the content didn't change, it would inherit it's verification status. If the content did change, it would trigger the webhook. If the provider changed, it would have ran verification against your main branch and prod (Not the feature branch). Maybe this is where the potential issue would be?

antonello
2020-12-03 19:39
I was about to write the same, yes.

phil.endsley
2020-12-03 19:40
The pact content doesn't change, but the provider did. The provider will run verification against main and prod (Not the feature branch). The provider changes in a way that would cause the feature pact to fail. Since the content doesn't change when merging the feature branch, it doesn't trigger the webhook

phil.endsley
2020-12-03 19:40
hmm

phil.endsley
2020-12-03 19:47
So in this case, even can-i-deploy wouldn't work? I've confused myself, as I usually do when trying to think out pact flows :sweat_smile:

phil.endsley
2020-12-03 19:47
We're trying to reduce the number of builds that are triggered

phil.endsley
2020-12-03 19:49
Wait...it wouldn't be pre-verified if the provider changed, right? Because the provider version would be different

antonello
2020-12-03 19:52
Exactly - if the provider changes after the feature branch webhook was triggered but before the feature branch is merged, without the behaviour I implemented, you will end up with a consumer that you can?t deploy. Right?

phil.endsley
2020-12-03 19:54
My suggestion would be to not fire it if the contract is pre-verified. As long as it's pre-verified, there's no need to run builds, right? If it's not pre-verified, fire the web hook

antonello
2020-12-03 19:57
If we stick to the provider master branch for simplicity, You?re saying that the webhook logic would have to check what if the latest master provider has verified that pact content already.

phil.endsley
2020-12-03 19:59
yes

antonello
2020-12-03 20:00
I can?t remember now - does the webhook have any awareness of which provider branch is triggering?

phil.endsley
2020-12-03 20:02
Did you mean which consumer branch is triggering?

antonello
2020-12-03 20:03
No - the provider branch

phil.endsley
2020-12-03 20:03
Either way, I'm not sure. Our webhooks trigger regular builds. We're just getting to the point of refining them, which prompted the question

antonello
2020-12-03 20:04
In order to > If we stick to the provider master branch for simplicity, You?re saying that the webhook logic would have to check what if the latest master provider has verified that pact content already You?d need to know the provider branch

antonello
2020-12-03 20:19
We have gone webhookless quite some time ago, so my experience is limited.

antonello
2020-12-03 20:31
If you think about it, what we do would be the equivalent of triggering webhooks every single time, regardless of whether the pact has changed, and then call can-I-deploy to see if the provider needs running

phil.endsley
2020-12-03 20:32
Do your webhooks trigger builds, or middleware? Is the can-i-deploy part of your actual build pipeline, or do you make that determination in middleware, then trigger the build?

antonello
2020-12-03 20:35
We have two different approaches, depending on whether the consumer builds on jenkins or gitlab ci, but in principal is the same.

antonello
2020-12-03 20:36
in gitlab ci we use so-called multi-project pipelines, a mechanism for an upstream project to trigger a build of a downstream project.

antonello
2020-12-03 20:37
when a downstream (provider) pipeline is triggered, it only runs a specific job that runs the provider tests

antonello
2020-12-03 20:38
and we trigger two downstream jobs for each consumer/provider, one for the main tag and one for the prod tag

antonello
2020-12-03 20:40
there is no middleware - all providers have a script that invokes can-i-deploy before running the tests. if can-i-deploy passes, no tests are run.

antonello
2020-12-03 20:46
@bethskurrie and @matt.fellows have written this https://github.com/pactflow/example-consumer-webhookless

antonello
2020-12-03 20:55
This shows a simplification of what would happen in the case of a feature branch of a consumer called `marketplace-api` and a provider called `review` when the pact is already pre-verified

antonello
2020-12-03 20:56
Same thing but if the pact is not pre-verified

bethskurrie
2020-12-03 21:13
There is a reason why the "and new tag applied" triggers the webhook but I have to get my head back around it again. Here are the notes past beth took for future beth https://www.evernote.com/l/AGEAreq5cm5HErJ-SNzn0sRxwQS0xH60JBA

bethskurrie
2020-12-03 21:14
One potential way we could improve this is to split out the existing contract_content_changed into two events `contract_content_changed` and `new_tag_applied` .

bethskurrie
2020-12-03 21:15
I've been hesitant to do this because while it's not a "breaking" change, it would change the behaviour for people who already have scripts that set up this webhook.

antonello
2020-12-03 21:17
It?s hilarious that we?re on the same boat when it comes to trying to remember exactly why it was the right thing to do!

bethskurrie
2020-12-03 21:44
I remember recently saying "thank you past beth for making the 'and new tag' thing trigger a build" for some reason related to WIP/pending pacts.

bethskurrie
2020-12-03 21:45
It was something to do with what happens when you merge multiple feature branches with pact changes back into master.

bethskurrie
2020-12-03 21:47
Well, "thank you past beth for letting Anto put that feature in" anyway :stuck_out_tongue:

phil.endsley
2020-12-03 22:39
yeah, I keep looking for an answer, but I think the issue is, for what I want, you have to know the provider tag you care about (Like Anto said). Since you can't determine that in isolation, I think we're just stuck with running can-i-deploy to short circuit. I think...it's been a long day...brain is fried...I'm done thinking :slightly_smiling_face:

antonello
2020-12-03 23:11
Could the webhook not take an optional provider tag as a parameter so that it can check for pre-verification?

bethskurrie
2020-12-03 23:12
Yeah...

bethskurrie
2020-12-03 23:12
I'll have to get my head back into it and think it through.

me1466
2020-12-03 23:42
has joined #pact-broker

wenfeng.li
2020-12-04 11:42
has joined #pact-broker

cdambo
2020-12-05 11:59
has joined #pact-broker

phil.endsley
2020-12-05 21:46
Ok, I know I've read about using `can-i-deploy` as a merge check for feature branches. We aren't doing this yet, but I'm at the point of looking into it now, but I can't find anything written about it. Tried reasoning through it without docs, but I can't work it out. Was going to read though, and come back with any remaining questions I had

matt.fellows
2020-12-06 11:46
This page talks about a "can I merge" use for that command. Helpful?


bethskurrie
2020-12-06 22:38
If you think of can-i-deploy as asking the question "is there a pact with a successful verification between [these] versions of [these] applications" then it might make more intuitive sense @phil.endsley

bethskurrie
2020-12-06 22:38
Before you merge you want to ask "is there a pact with a successful verification between the head of my consumer branch and the main branch of the provider?"

bethskurrie
2020-12-06 23:58
Or, whatever branch of the provider is in the environment you care about. It's actually no different to can-i-deploy from the master branch.

phil.endsley
2020-12-07 00:25
Hmm...that makes sense. I think that will work for us. We would have issues if we have multiple providers with different main branch names (ex: develop and main). That's not the case now though, so I think we'll be fine

bethskurrie
2020-12-07 00:25
I think it should be the name of the deployment environment actually

bethskurrie
2020-12-07 00:25
not main

bethskurrie
2020-12-07 00:26
because theres no point merging if the provider code is in master but not deployed

bethskurrie
2020-12-07 00:26
your consumer pipeline will just break at can-i-deploy on master.

phil.endsley
2020-12-07 00:27
Env for dev or prod? In dev, teams are often deploying feature branches. But maybe it still holds true of just checking what's currently there...

bethskurrie
2020-12-07 00:28
I'd use dev

bethskurrie
2020-12-07 00:28
I guess you choose where you want it to break!

phil.endsley
2020-12-07 00:28
Because deploying other branches would still run the can I deploy check

bethskurrie
2020-12-07 00:28
if you want to be prevented from merging until the feature is in dev, use dev, and if you want to be allowed to merge, but not deploy, then use "main" or whatever the main branch name is.

bethskurrie
2020-12-07 00:29
as you say though, you'd need to use the full form of the can-i-deploy to specify the different names of the provider's branches if they are different.

bethskurrie
2020-12-07 00:30
or, add a tag name that everyone can agree on for their main line, and you can use two tags.

bethskurrie
2020-12-07 00:30
one to represent the branch, and the other to represent the "stage"

bethskurrie
2020-12-07 00:34
So, this workflow works both on branches and on master


bethskurrie
2020-12-07 00:35
if you set up your webhooks right, you can make the publishing of the verification results kick off a build of the consumer branch again so that can-i-deploy goes green automatically.

stefanos.varsanis
2020-12-07 09:25
@bethskurrie Any thoughts on that? Thanks :slightly_smiling_face:

robert.strehli
2020-12-07 13:31
Hi, I have a question. Is there a way to look at older pact revisions on the pact broker? For understanding: I published a pact with version 1.0. Then I changed the pact on consumer side (just changed the response status from 200 to 204) and published it again but I didn't changed the version of the consumer so it's still 1.0. Can I somehow view the pact where the response status is still 200? If I click on the older revision in the matrix I always get the latest version.

antonello
2020-12-07 17:55
If you?ve published the pact with the same version (1.0), I believe it would be overwritten.

bethskurrie
2020-12-07 23:24
@robert.strehli you aren't supposed to overwrite with the same consumer version, but yes, you can see it if you want to.

bethskurrie
2020-12-07 23:26
Actually, I've just checked the routes, and I haven't exposed it. If you modify an existing pact for a consumer version it make a revision in the database, so the original one is still there. But I haven't made a route that allows you to see the /revision/1 yet.

bethskurrie
2020-12-07 23:27
You really have to bump the consumer version each time or you'll run into trouble.


gayatree.eee
2020-12-08 04:50
has joined #pact-broker

guppy0356.nakira
2020-12-08 07:22
Hi, I have some questions about system requirements. In this page (https://docs.pactflow.io/docs/on-premises/system-requirements/#postgres-database-instance), the storage of postgres database instance is 5 GiB. The minimum storage is 100 GiB in my aws console. I confused which parameter is 5 GiB :thinking_face:

matt.fellows
2020-12-08 07:25
This may come as a suprise to you, but not everyone runs in AWS :rolling_on_the_floor_laughing:

matt.fellows
2020-12-08 07:26
Also, you can definitely have a 5gb RDS instance

matt.fellows
2020-12-08 07:28
Also note that those instructions are for our enterprise on premise appliance and not the OSS broker (albeit the infra requirements are going to basically be the same so you can definitely use it as a guide)

matt.fellows
2020-12-08 07:30
Check your storage volume options. GP2 without dedicated iops should allow 5gb

matt.fellows
2020-12-08 07:32
Check also instance class

c.pavan1986
2020-12-09 04:18
has joined #pact-broker

robert.strehli
2020-12-09 08:03
Thank you for your answer. I'm currently in a try out phase so I didn't really mind the versioning part, but that's now a good learning. :thumbsup:

william.pritchard
2020-12-09 15:28
has joined #pact-broker

parveshchaudhary111
2020-12-09 17:54
has joined #pact-broker

w.sobasik
2020-12-10 10:39
has joined #pact-broker

olarrmide
2020-12-10 14:51
has joined #pact-broker

jarmy
2020-12-11 00:56
@bethskurrie I've deployed a new version of the pact-broker with puma running ssl. The tagging issue with forward slashes is fixed.

thanuxxxx
2020-12-12 22:41
has joined #pact-broker

ian.hamilton
2020-12-13 06:53
has joined #pact-broker

colm.j.murphy91
2020-12-13 07:02
has joined #pact-broker

victoria.kruczek
2020-12-13 14:13
has joined #pact-broker

wuddarwin
2020-12-14 05:23
has joined #pact-broker

connor.aird
2020-12-14 15:52
has joined #pact-broker

arman.najafian
2020-12-14 15:52
has joined #pact-broker

praveen.lakkaraju
2020-12-14 16:12
has joined #pact-broker

alejandro.germain
2020-12-14 16:26
has joined #pact-broker

ukrainian1991
2020-12-14 16:43
Hi, Is it possible to remove verification result from pact broker? I have published with a wrong provider version

matt.fellows
2020-12-14 23:19
Off the top of my head I?m not sure. But try issuing a DELETE to the resource and see what happens

bethskurrie
2020-12-14 23:19
Yes. What Matt said.

josh.ellinger
2020-12-15 01:22
has joined #pact-broker

mateusz.derks
2020-12-15 05:46
Hey, is this feature under some additional research before going live? It?s still hidden behind a feature flag from what I see https://github.com/pact-foundation/pact_broker/blob/master/lib/pact_broker/pacts/metadata.rb#L36

bethskurrie
2020-12-15 05:47
Tomorrow is my OSS day, so I'll do a release then.

nikitsenka
2020-12-15 09:35
has joined #pact-broker

hibahawes
2020-12-15 09:53
has joined #pact-broker

sarvar
2020-12-15 14:24
has joined #pact-broker

dattasai.chunduru
2020-12-15 16:26
Hi Team When we are trying to publish Pact files to PactBroker we are getting error as below, can you please help on this PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

dattasai.chunduru
2020-12-15 16:42
I am using JVM gradle Project

kjayachandra2000
2020-12-15 16:45
```pact { publish { pactDirectory = "$buildDir/pacts" pactBrokerUrl = 'http://localhost:80' tags = ["dev", "test", "prod"] } }``` i am using this config to publish and it's working fine for me `./gradlew clean pactPublish`

bethskurrie
2020-12-15 22:28
:tada: @jarmy

bethskurrie
2020-12-15 22:37
@kjayachandra2000 this is a client side JVM/configuration issue. Best to ask in #pact-jvm

bethskurrie
2020-12-15 22:38
It's strange that it's looking for a certificate given you're not running your broker on SSL though.

suruchipatidar14
2020-12-16 05:35
has joined #pact-broker

suruchipatidar14
2020-12-16 05:42
Hello, I am using pact-jvm to do contract testing. Pact broker is not installed in my system. Could you guide me how I can generate pact broker URL to create and update pacts ?

bethskurrie
2020-12-16 05:43
What docs have you read so far?

suruchipatidar14
2020-12-16 05:43
read documents from http://pact.io

bethskurrie
2020-12-16 05:44
What docs from the Pact Broker section have you read?

suruchipatidar14
2020-12-16 05:45
I have read docs on dockerized pact broker and pact broker cli but got confused

bethskurrie
2020-12-16 05:45
Can you use Docker?

suruchipatidar14
2020-12-16 05:45
I can not install docker due to some limitation

bethskurrie
2020-12-16 05:46
I would recommend signing up for a free Pactflow account then. https://pactflow.io/

bethskurrie
2020-12-16 05:47
This is the only option that doesn't use Docker or require you to manually install and run a Ruby application on your own hardware.


suruchipatidar14
2020-12-16 05:48
Okay thanks

suruchipatidar14
2020-12-16 05:51
I am using aws sandbox in my project. Can I create pact broker url based on sandbox url ?

bethskurrie
2020-12-16 05:51
You need a pact broker running first

bethskurrie
2020-12-16 05:51
There needs to be an actual Pact Broker running application for you to have a Pact Broker URL.

bethskurrie
2020-12-16 05:52
You can't publish to thin air!

suruchipatidar14
2020-12-16 05:53
Okay. If running Pact broker is present in other platform, then what details of pact broker will be required in my project use it ?

bethskurrie
2020-12-16 05:53
These are the docs for the Pactflow on-premises application. You would need something similar for the OSS Docker image.


bethskurrie
2020-12-16 05:55
> hen what details of pact broker will be required in my project use it You will need the base url (eg. https://my-broker.my-org.com) and the username/password (if they're configured in the docker container).

suruchipatidar14
2020-12-16 05:55
Okay Thanks for your help.

smatheson
2020-12-16 06:33
has joined #pact-broker

yann.courtel
2020-12-16 13:49
Hi Valadzko. We are in the same situation. We have a single broker for the whole organization. And an extra for sandboxing. Migration shouldn't be an issue, as soon as you switch to the single broker your pacts should be published seamlessly at build time. You will lose your history though.

olayemifolakemi
2020-12-16 15:23
has joined #pact-broker

nouri.tawfik
2020-12-16 19:22
has joined #pact-broker

kflo
2020-12-16 22:50
in pacts for verification, what are the provider version tags used for?

bethskurrie
2020-12-16 22:50
to work out whether or not a particular pact content is pending


kflo
2020-12-16 22:50
thanks, was trying to find where that was documented

kflo
2020-12-16 22:55
i guess this configuration is to allow provider builds that are based on pending contracts to pass, while still marking them as failed in the broker (so consumers won?t use them until they are not pending)?

bethskurrie
2020-12-16 23:01
yes

bethskurrie
2020-12-16 23:01
The pending status only affects the provider builds. To the consumer, it's still just a fail.

kflo
2020-12-16 23:02
you?ve probably answered this a billion times, sorry :stuck_out_tongue: just trying to make sure my config is setup correctly

bethskurrie
2020-12-16 23:03
> While the provider build may pass, the verification results are still reported (if results publishing is enabled) to the Pact Broker as "failed", as the consumer should not be able to deploy the code that generated this contract.

bethskurrie
2020-12-16 23:03
If there's anything that is unclear after reading that page thoroughly, let me know, so I can add or clarify it.

kflo
2020-12-16 23:05
i think the feature makes sense. what i was confused by is that it seems i can provide an empty list of provider tags, which i guess makes sense if i?m not using tags at all? but if i am using tags, it seems like i would want to, in my CI system, probably pass the same tags that i?m filtering the latest consumer pacts on (e.g. `master`/`production`), and if i?m doing a local verification against a branch, for example, i would instead pass that as the tag (e.g. `feat-x`)

bethskurrie
2020-12-16 23:06
you pass it the name of whatever branch you're on.

bethskurrie
2020-12-16 23:06
on CI or locally.

kflo
2020-12-16 23:06
hm, so it doesn?t need to know about the ?environment?/?deployment? tags?


bethskurrie
2020-12-16 23:07
when you're verifying, you only need to use the branch names.

bethskurrie
2020-12-16 23:07
Unless you've checked out the production version of the provider, and you're using that particular revision to do a verification.

bethskurrie
2020-12-16 23:08
> The Golden Rule for tagging is: > Tag with the branch name when you publish pacts or verification results, and tag with the environment name when you deploy.


kflo
2020-12-16 23:10
ok, i think i get it

kflo
2020-12-16 23:12
we use a monorepo so i will need to come up with a non branch based strategy for using the same tag

kflo
2020-12-16 23:12
across the consumer/provider

bethskurrie
2020-12-16 23:12
that doesn't make sense to me.

bethskurrie
2020-12-16 23:12
the consumer/provider tags are independent of each other

bethskurrie
2020-12-16 23:13
they don't have to match.

bethskurrie
2020-12-16 23:13
you don't need to overthink this - just tag with the branch name every time you publish.

bethskurrie
2020-12-16 23:13
it'll work out.

kflo
2020-12-16 23:13
> A common pattern to use when adding new features is for the provider to make a branch with the same name as the consumer?s branch (which is used to create the consumer version tag), and to configure a selector that uses the name of the current provider branch

bethskurrie
2020-12-16 23:14
You can do that - but you don't have to.

bethskurrie
2020-12-16 23:15
Are you making one branch in the mono-repo for the consumer, and another branch to implement in the provider?

kflo
2020-12-16 23:16
that would be our normal development cycle, but maybe we don?t need to do it that way anymore

kflo
2020-12-16 23:16
although the provider changes would need to merge first, right?

bethskurrie
2020-12-16 23:16
There has been a request to use a regular expression for the tag in the consumer version selector

kflo
2020-12-16 23:17
yeah, i was considering doing something like extracting a ticket number

bethskurrie
2020-12-16 23:17
the usual order of dev goes: consumer branches, updates the pact publishes, provider branches, implements the pact, provider merges, consumer merges.

kflo
2020-12-16 23:17
yep, so two branches

bethskurrie
2020-12-16 23:18
in your case, you could do the work on the same branch :wink:

kflo
2020-12-16 23:18
hm, but wouldn?t i want the provider to deploy before the consumer

bethskurrie
2020-12-16 23:19
fair point.

kflo
2020-12-16 23:19
sounds complicated

bethskurrie
2020-12-16 23:19
no, you wouldn't want the consumer to deploy before the provider.

bethskurrie
2020-12-16 23:19
you need the provider to deploy first.

bethskurrie
2020-12-16 23:19
so the feature is already there for the consumer to use.

bethskurrie
2020-12-16 23:19
yes, that is more complicated in a mono repo.

bethskurrie
2020-12-16 23:20
you might just need to manually set the consumer tag to verify when you branch the provider. that's common too.

kflo
2020-12-16 23:20
i was cruising along until i saw the provider tag versions and then i got confused haha. i think i?ll need to think on this for a bit

kflo
2020-12-16 23:20
yeah, i think i?m okay with that

bethskurrie
2020-12-16 23:20
some people keep a file that has the mapping of consumer/provider feature branches.

bethskurrie
2020-12-16 23:21
but you really only need it while the provider branch is active.

kflo
2020-12-16 23:26
just one thing to clarify, you said the provider/consumer tags don?t have to match, but i thought that?s how the broker knows when to change the ?pending? status (e.g. consumer publishes with tag `feat-x`, provider verifies with tag `feat-x`)?

bethskurrie
2020-12-16 23:27
no

bethskurrie
2020-12-16 23:27
it looks at the pact content that has been selected, and says, "is there a successful verification from a version of the provider with the supplied provider version tag?"

kflo
2020-12-16 23:28
ohh, so it?s just there to see if it has verified a provider with that tag before against those specific pacts?

kflo
2020-12-16 23:29
ok, i think i get the provider tag now

bethskurrie
2020-12-16 23:29
so the consumer tags are there for you to select the right pacts, and the provider version tags are there to work out whether the *content* for each pact is pending

kflo
2020-12-16 23:29
ok, now i see why they don?t need to match

bethskurrie
2020-12-16 23:30
the matching thing is just a convenient way of selecting the right pact without having to change your provider configuration.

kflo
2020-12-16 23:30
yeah, when determining which consumer pacts to verify against right?

bethskurrie
2020-12-16 23:32
yes

ania.kovalchuk
2020-12-17 00:09
has joined #pact-broker

writetojoshma
2020-12-17 05:52
has joined #pact-broker

guppy0356.nakira
2020-12-17 10:00
Hi, I need your help. My pact broker uses self signed SSL. I can't publish contract to broker. How to disable this verification?

bethskurrie
2020-12-17 10:01
It depends on the language you're using.

bethskurrie
2020-12-17 10:01
it's all about the client, not the server.


bethskurrie
2020-12-17 10:02
Why don't you use the certificate to make it use the SSL properly?


bethskurrie
2020-12-17 10:04
Or, get your broker deployed without SSL.

bethskurrie
2020-12-17 10:05
You just need the self signed certiciate in PEM format, and set the environment variable `SSL_CERT_FILE=<path to your ceritificate>`

guppy0356.nakira
2020-12-17 10:05
I can't deploy broker without SSL because my boss's order.

bethskurrie
2020-12-17 10:06
well, it's time to learn how to configure your client properly!

brendan.donegan
2020-12-17 10:06
@guppy0356.nakira you need to get the certificate and pass it as @bethskurriementioned

brendan.donegan
2020-12-17 10:06
this is what we do

guppy0356.nakira
2020-12-17 10:07
Okay, I will talk with my Boss.


bethskurrie
2020-12-17 10:08
Someone will probably have a copy of the certificate as a PEM file hanging around though.

bethskurrie
2020-12-17 10:08
Find the person who deployed it.

matt.fellows
2020-12-17 10:47
Better yet, use a real certificate provider :troll:

matt.fellows
2020-12-17 10:47
With let's encrypt there is just no good reason these days. I think you use AWS as well, so you have ACM

rejeesh.g
2020-12-17 11:07
has joined #pact-broker

lukas.kempec
2020-12-17 12:45
has joined #pact-broker

vikas543
2020-12-17 16:28
has joined #pact-broker

patrick.hendron
2020-12-17 16:56
I might be asking this is the wrong place, but is it possible to publish a contract to a S3 bucket using the PACT lib, if i provide the s3 url for the option `pactBroker:` ? or would I have to write custom code to send it to a s3 bucket (i am using node)

bpugh
2020-12-17 17:05
has joined #pact-broker

bethskurrie
2020-12-17 19:25
@patrick.hendron you'd need to write custom code to publish to s3


guppy0356.nakira
2020-12-18 07:44
What is the purpose for `--consumer` and `--provider` on `create-or-update-webhook` ?

nouri.tawfik
2020-12-18 08:28
https://docs.pact.io/pact_broker/webhooks/ "Webhooks allow you to trigger an HTTP request when a pact is changed, a pact is published, or a verification is published" For each contrat we have a consumer and provider....

guppy0356.nakira
2020-12-18 09:28
@nouri.tawfik Thank you for your respond. Should I have to add both options?

matt.fellows
2020-12-18 09:42
They just reduce the scope of when the webhook fires

matt.fellows
2020-12-18 09:43
If you select none, it will fire for all events. If you select a provider, it just fires for events related to that provider and so on

patrick.hendron
2020-12-18 09:48
Thanks so much Beth for this

guppy0356.nakira
2020-12-18 09:49
@matt.fellows Okay! I understand :bananadance:

yann.courtel
2020-12-18 13:59
Hi guys, this might be a redundant question but do you know what's the best version of the pact broker we can use ? between https://hub.docker.com/r/dius/pact-broker and https://hub.docker.com/r/pactfoundation/pact-broker ? Thanks a lot

matt.fellows
2020-12-18 21:23
You probably want to Use the pactfoundation one if you can in most cases. It's a smaller image (alpine) and is close to what we run at Pactflow

matt.fellows
2020-12-18 21:24
I think the docs for the first one explains when you might want one over the other

jeff.burmood
2020-12-19 17:45
has joined #pact-broker

kyle.florence
2020-12-19 19:21
has joined #pact-broker

ankurmalik22
2020-12-19 21:14
has joined #pact-broker

vsukumaran
2020-12-20 01:56
has joined #pact-broker

omer.morad
2020-12-20 08:10
has joined #pact-broker

ringo
2020-12-20 10:51
has joined #pact-broker

omer.moradd
2020-12-20 18:01
has joined #pact-broker

yann.courtel
2020-12-21 08:16
Hey Matt. I see the difference now. Unfortunately we have a dius installed. I'll see to install the pact-foundation one at least on our sandboxing server and go from there. Thanks a lot!

matt.fellows
2020-12-21 08:17
I wouldn't bother changing unless you have a good reason to

yann.courtel
2020-12-21 09:19
duly noted! Thanks

matt.fellows
2020-12-21 09:46
The main reasons you would migrate IMO 1. You can't run with root privileges 2. You're having issues with the existing image 3. There is some policy about containers using alpine Otherwise :man-shrugging:

matt.fellows
2020-12-21 09:47
For most the change should be simple. When we switched at Pactflow, it was a lot more work to switch because of scale and monitoring etc

matt.fellows
2020-12-21 09:48
We monitored a lot of the processes and used them as scaling properties. I would guess most have fairly simple setups so it could be a couple of hours work :thinking_face:

souravsen1
2020-12-21 11:28
has joined #pact-broker

andoni.arroyo
2020-12-21 17:51
has joined #pact-broker

writetojoshma
2020-12-22 05:41
Hey anyone know how to make my pactflow broker hit my graphql which is up on a localhost server

writetojoshma
2020-12-22 05:41
i was getting connection refused error by broker

matt.fellows
2020-12-22 05:47
Just so we?re clear, Pactflow does not talk to your APIs. It is simply a way to exchange pact files

matt.fellows
2020-12-22 05:47
think of it like Git - it is a way to stores, versions, tag etc. for your code

matt.fellows
2020-12-22 05:47
Pact broker does the same thing, but for contract files

matt.fellows
2020-12-22 05:48
Pact is the tool that talks to your services, and runs from your local machine to another process (usually also on your same machine)

matt.fellows
2020-12-22 05:49
> i was getting connection refused error by broker That almost certainly means one of a few things: 1. The provider API is not up 2. The configuration is incorrect, and Pact is trying to talk to a process on another port 3. There is a timing issue and the tests are firing before the provider itself is up

matt.fellows
2020-12-22 05:49
I think you use Pact JS, so probably best to share code examples with evidence on how it?s not working as expected, what you?ve done to investigate etc.

writetojoshma
2020-12-22 05:51
Oh okay Thanks for the clarification

writetojoshma
2020-12-22 05:51
I tried local host port as my actual provider api

writetojoshma
2020-12-22 05:51
It was throwing connection refused error

writetojoshma
2020-12-22 05:52
Then I tried with a public api....the entire flow worked fine

writetojoshma
2020-12-22 05:52
Including provider verification

writetojoshma
2020-12-22 05:52
So I was wondering pact is not hitting local host

writetojoshma
2020-12-22 05:53
Okay...

theovanessen
2020-12-22 10:47
has joined #pact-broker

stuart3166
2020-12-22 12:35
has joined #pact-broker

winfante
2020-12-22 22:51
has joined #pact-broker

writetojoshma
2020-12-23 05:10
i want pact to hit the localhost server . Do you know if its possible ?

matt.fellows
2020-12-23 05:11
of course, that is how it is supposed to be used :slightly_smiling_face:

matt.fellows
2020-12-23 05:11
all of the provider examples we?ve written do exactly this

writetojoshma
2020-12-23 05:12
Okay , what if I have to run a command to make the localhost up from my local cmd

writetojoshma
2020-12-23 05:12
I can do it manually

writetojoshma
2020-12-23 05:12
And then if I run the provider test

writetojoshma
2020-12-23 05:12
It should be working ?

writetojoshma
2020-12-23 05:13
I was getting connection refused error

matt.fellows
2020-12-23 05:13
however you want to start the provider is up to you. Whether before you run the tests, or via the test runner itself

matt.fellows
2020-12-23 05:14
it just needs to be listening on a port that Pact knows about

writetojoshma
2020-12-23 05:14
Okay okay

writetojoshma
2020-12-23 05:14
Got it

matt.fellows
2020-12-23 05:14
If you?re getting connection refused by the pact test, that means you?re not pointing at a running provider

matt.fellows
2020-12-23 05:14
it doesn?t matter where the provider is running - as long as it is reachable

writetojoshma
2020-12-23 05:15
Okay ...

writetojoshma
2020-12-23 05:28
Hey , sorry to bother again .

writetojoshma
2020-12-23 05:30
I am able to access my url from postman

writetojoshma
2020-12-23 05:30
From local

writetojoshma
2020-12-23 05:30
Same url when I keep it my providerurl in the provider-spec.js and run the provider test

writetojoshma
2020-12-23 05:30
I am getting error

writetojoshma
2020-12-23 05:31
No connection could be made because the target machine actively refused it

writetojoshma
2020-12-23 05:31
But if use any public api as provider url ....full flow is working fine

writetojoshma
2020-12-23 05:40
Hey it worked

writetojoshma
2020-12-23 05:40
Thanks a lot !!!

writetojoshma
2020-12-23 05:40
:grinning:

matt.fellows
2020-12-23 05:41
:raised_hands::raised_hands:

writetojoshma
2020-12-23 05:43
If a pact breaks , the jenkin job should be RED , Any examples for that

writetojoshma
2020-12-23 05:43
CI-CD integration of PACT

matt.fellows
2020-12-23 05:51
You're going to need to show code here for us to be able to help

matt.fellows
2020-12-23 05:52
Localhost would assume port 80. Is your provider running in Port 80?

writetojoshma
2020-12-23 05:53
Sorry this was an older issue

writetojoshma
2020-12-23 05:53
Its resolved

writetojoshma
2020-12-23 05:53
Thanks for ur reply

matt.fellows
2020-12-23 05:53
Same as any unit test. Non zero exit code should break any ci build

writetojoshma
2020-12-23 05:53
Can you please comment about the CI CD integration I asked for in the other chat box

matt.fellows
2020-12-23 05:53
:+1:

writetojoshma
2020-12-23 05:54
Okay

writetojoshma
2020-12-23 05:54
:+1:

writetojoshma
2020-12-23 07:18
What is the role of consumer.js file for consumer.spec.js file in graphql testing

matt.fellows
2020-12-23 11:08
?

lars.bonnes
2020-12-23 13:05
has joined #pact-broker

eungjun.yi
2020-12-25 14:25
has joined #pact-broker

ebanster
2020-12-27 13:18
has joined #pact-broker

onur.baskirt
2020-12-28 10:48
has joined #pact-broker

massimo.daros
2020-12-29 13:18
has joined #pact-broker

chris.fullinwider
2020-12-29 18:15
has joined #pact-broker

jks
2020-12-29 22:05
has joined #pact-broker

jks
2020-12-29 22:45
Hello, I have a question concerning best way to organize consumer and provider tests to support CI/CD on PactBroker. My Pact Consumer Test file produces 3 pacts. My Pact Provider Test file verifies these 3 pacts. This worked fine when I was running pactPublish and pactVerifyProvider independently from the command line. However, I started working with webhooks and CI/CD to follow the https://docs.pact.io/pact_broker/webhooks#example-cicd-and-webhook-configuration. Now do I create a ?contract_published? event on each of the 3 pacts to notify the Provider build/test, and similarly create a ?provider_verification_succeeded? event on each of the 3 pacts to notify the Consumer to deploy? I guess what I?m getting at is that it seems you?d want the ability to have multiple pacts in one project, but it?s not obvious what happens when multiple pacts are published from the same project or similarly multiple pacts that originated from the same project are verified. It?s entirely possible I?m overlooking something.

matt.fellows
2020-12-30 01:02
Why does your consumer publish 3 pacts? Usually each consumer has a single contract (even if it has multiple interactions) with one or more providers

matt.fellows
2020-12-30 01:03
It's unusual to have more than one contract between a single consumer and provider

matt.fellows
2020-12-30 01:03
I.e. one contract should capture all of the interactions of the integration point from the perspective of the consumer

jks
2020-12-30 02:56
I didn?t write the consumer, so I?m not sure exactly why it was written this way. It?s one consumer but three different providers, hence three pacts. Say you have a consumer that interacts with different providers; seems logical. I could break apart the test code into different files, but I?d still have the same issue. From a build/test/deploy perspective I need to organize the build script to handle publishing each independently. Pretty sure I can do this, but wasn?t thinking along these lines earlier. Thanks.

matt.fellows
2020-12-30 03:07
Ah that's fine. Totally normal

matt.fellows
2020-12-30 03:08
Why do they need to be published independently? Or rather, could you please elaborate? You should be able to publish all in a single command using the CLI tools

matt.fellows
2020-12-30 03:09
Same for the can-i-deploy. It should automatically work out if the consumer is compatible with all of its stated providers in a single call

matt.fellows
2020-12-30 03:11
Ah, I think I was confused because you said the provider verifies all 3 contracts

matt.fellows
2020-12-30 03:13
Depends on how you trigger provider builds. I would create a single webhook for the provider (omitting the consumer name, so any consumer publishing/changing a pact for that provider will trigger the build)

jks
2020-12-30 15:57
I think my confusion lies in how to organize the interaction between the webhooks on the PactBroker and the build script in the CI/CD environment. I have multiple pacts for the one consumer project. 1. The consumer publishes the 3 pacts to broker 2. Broker notifies each provider via webhook to fetch and verify 3. Each provider verifies results and sends back to broker 4. Now each of the three pacts has a webhook on broker to notify consumer of results; therefore the consumer will be notified three separate times So on step #4, how does the consumer CI/CD handle this? Seems it should only deploy if it gets three positive results. Or is it possible to group pacts for the same consumer to only notify via webhook if all providers verified pacts?

piotr.soltysiak
2020-12-30 16:55
has joined #pact-broker

matt.fellows
2020-12-31 00:41
Right.

matt.fellows
2020-12-31 00:42
so personally, i don?t bother making my consumer CI aware of verification results from any providers ?inline? to my pipeline. I find it makes things harder to understand - I?d prefer to keep them independent (apart from the webhook to trigger the provider pact specific build). I run can-i-deploy and if I can?t deploy, the build fails. The verification results are used as feedback to my SCM tool (such as Github) to notify when it is ready to merge).

matt.fellows
2020-12-31 00:43
This workshop might be helpful also: https://docs.pactflow.io/docs/workshops/ci-cd

jks
2020-12-31 02:34
Thanks for the tips. I?ll look at that workshop.

bethskurrie
2021-01-03 21:41
@yann.courtel if you deploy the passenger (DiUS) one in an autoscaling architecture, the Passenger scaling and process management logic can fight with the instance scaling and process management logic, so the official advice from the passenger vs puma people is to use the puma one. Having said that, we ran the Passenger one for ages for Pactflow, and we didn't notice any problems.

adrian.przybyla
2021-01-04 13:41
has joined #pact-broker

dcorrales
2021-01-04 22:06
has joined #pact-broker

jokubas.lekevicius
2021-01-04 22:10
has joined #pact-broker

guppy0356.nakira
2021-01-05 09:48
@matt.fellows I need your help again about `--consumer` and `--provider` . My application has two roles. One is consumer and other is provider. Is it possible run following command? ```pact-broker create-or-update-webhook .... --provider sampleapp --consumer sampleapp```

guppy0356.nakira
2021-01-05 14:31
Can I create webhooks like these? I select `--consumer` and `--provider` . These have same application name. ```pact-broker create-or-update-webhook \ "https://api.github.com" \ --request POST \ --uuid ee8fd2d6-9e42-410b-afef-069468fdca79 \ --consumer Foo \ --provider Foo``` ```pact-broker create-or-update-webhook \ "https://api.gitlab.com" \ --request POST \ --uuid 452c5884-5e65-4993-9934-c406711d1e99 \ --consumer Foo \ --provider Foo```

brendan.donegan
2021-01-05 14:44
I don?t think that consumers and providers should have the same name

brendan.donegan
2021-01-05 14:44
If they are the same thing why do you need to use Pact?

guppy0356.nakira
2021-01-05 14:45
My application has two roles. One is consumer and other is provider for another application.

jgfarias42
2021-01-05 14:46
Better to use threads on the original message

jgfarias42
2021-01-05 14:46
Better to use threads on the original message

guppy0356.nakira
2021-01-05 14:47
My application has two roles. One is consumer and other is provider.

guppy0356.nakira
2021-01-05 14:48
I want to fire above webhooks on uploading pact as consumer and publish verification as provider.

jgfarias42
2021-01-05 14:49
.

jgfarias42
2021-01-05 14:51
[can-i-deploy] I?m trying to run _can-i-deploy_ via Maven+Pact JVM for the first time in a few service I already have Pact, however I?m facing a weird issue. My providers? version on the broker are tag as XYZ-SNAPSHOT, due to Maven?s behavior. When I run ``` mvn pact:can-i-deploy -Dpacticipant='MyConsumer' -DpacticipantVersion="1.1.63" -DtoTag="devTag"``` I get that only one of my integrations have a problem, lacking the verification against the provider?s version 0.0.101 However, the first image shows that the contract was verified, against the version 0.0.101-SNAPSHOT The second image shows another provider, also with XYZ-SNAPSHOT format, where the integration was verified, but the _can-i-deploy_ apparently accepted. I can?t see a difference between these two integrations. (Note: I?m posting here because the ?There is no verified pact between? message is part of the Broker, not Pact JVM. But I can move the quesiton to #pact-jvm)

brendan.donegan
2021-01-05 14:53
that?s fine, you can specify the event type as a command line argument. but you still shouldn?t have a contract between your application and itself, even though it does take the consumer role and the provider role

phil.endsley
2021-01-05 14:57
can-i-deploy is failing because there is not a verified contract between the given pacticipant (`MyConsumer`) and each other integration it has (The two providers) for the _*latest version*_ tagged with `devTag` . The difference between the two providers in your screenshot, is 0.0.44 is the latest version of that provider tagged with `devTag`. 0.0.101 is not. This is shown in the UI by how the tag is displayed (Solid blue if it's the latest, grey if not). When you use the `-toTag` property, it will only check against the latest tag. Since there's a missing verification for that provider, it fails

matt195
2021-01-05 16:35
has joined #pact-broker

rafael.manzoni
2021-01-05 17:56
has joined #pact-broker

animesh2712
2021-01-05 19:29
has joined #pact-broker

info
2021-01-06 01:55
has joined #pact-broker

bethskurrie
2021-01-06 04:09
@guppy0356.nakira you need two separate webhooks then.

bethskurrie
2021-01-06 04:09
That webhook will never fire because there is no pact between Foo and itself.

bethskurrie
2021-01-06 04:10
You need to work out what event you want the webhook to fire for and that tells you which role to specify.

bethskurrie
2021-01-06 04:11
For a provider, you typically say "--provider Bar --contract-content-changed" when you want to trigger a pact verification build when any of the pacts change.

bethskurrie
2021-01-06 04:12
For a consumer you'd typically say "--consumer Foo --verification-..." to trigger something (maybe a deployment) when a verification result is published for that consumer.

guppy0356.nakira
2021-01-06 06:21
I want to fire event on publishing verification. I create a webhook like this "--consumer Foo --verification-...". When a provider developer create a bug, webhook will be fired and consumer's ci job will be failed. Sometimes this job failure on consumer is confusing. How to prevent this? Pending Pact is only for Provider?

bethskurrie
2021-01-06 08:27
How and why does it fail the consumer's CI job?

bethskurrie
2021-01-06 08:28
Pending is only for the provider.

pascal.libenzi
2021-01-06 10:57
has joined #pact-broker

guppy0356.nakira
2021-01-06 12:08
> How and why does it fail the consumer's CI job? `can-i-deploy` is executed in consumer's CI job.

guppy0356.nakira
2021-01-06 12:22
Red circled webhook is for `can-i-deploy` , isn't it? I am worried about failed provider verification. This verification fires webhook which call consumer's CI job. This job will be failed.

jgfarias42
2021-01-06 13:30
Thanks, indeed there was some confusion because I?m still setting these tags manually. I created a new release on the some code base and created the tag. Now it works.

brett
2021-01-06 18:55
has joined #pact-broker

josh.rosenfeld
2021-01-06 19:39
has joined #pact-broker

bethskurrie
2021-01-06 22:41
Wouldn't you want to know if it failed?

bethskurrie
2021-01-06 22:41
Would you prefer to deploy the consumer with the provider bug?

bethskurrie
2021-01-06 22:42
It sounds like it's correctly reporting that no, you can't deploy.

bethskurrie
2021-01-06 22:42
What you could do is only trigger it when the verification is successful though.

bethskurrie
2021-01-06 22:42
That way it wouldn't even be invoked if the verification failed.

bethskurrie
2021-01-06 22:43
`create-webhook --provider-verification-succeeded`

brett
2021-01-06 23:01
Hey guys, I've got my PACT json file generated in my Angular project (karma + jasmine) and I can't seem to publish it to Pactflow as shown in the tutorial. I get this error when I run npm run publish: "Error making request - NoMethodError undefined method `[]' for nil:NilClass..." Do I need to set up a separate/custom publish.js file? Here is what is in my package.json: ```"publish": "npx pact-broker publish pacts --consumer-app-version=1 --broker-base-url=[redacted] --broker-token=[redacted] --tag master"``` I've been searching for over an hour and can't seem to make progress. Any help is much appreciated, as I imagine I'm missing something quite simple. Thanks!

guppy0356.nakira
2021-01-07 01:13
If provider's feat branch always verifies the contract which is created by consumer's master branch. So, I don't want to overwrite CI job result.

bethskurrie
2021-01-07 01:14
ah, you only want the webhook to trigger deployment from the master results.

guppy0356.nakira
2021-01-07 01:14
yes

bethskurrie
2021-01-07 01:14
That's not supported yet, but you can pass through the tags from the version associated with the verification result, and you can do some logic inside the CI job.

guppy0356.nakira
2021-01-07 01:16
`create-webhook --provider-verification-succeeded` is prefer to me.

bethskurrie
2021-01-07 01:16
yes, but that will be triggered by all the provider branches.

bethskurrie
2021-01-07 01:16
as you said.

bethskurrie
2021-01-07 01:16
and you only want to trigger a deployment of the consumer when the master provider passes, yes?

guppy0356.nakira
2021-01-07 01:17
yes

bethskurrie
2021-01-07 01:17
the way to do that is to make the CI job do that check.

bethskurrie
2021-01-07 01:18
pass the provider version tags though in the body of the webhook request.

matt.fellows
2021-01-07 04:28
hmm, can you please add `--verbose` to see what is going on? I?m guessing a parameter hasn?t been given (by the looks of it, you?re not passing in the actual path(s) to the pact file)

bethskurrie
2021-01-07 04:28
there should be a ruby backtrace somewhere

matt.fellows
2021-01-07 04:28
ah, nevermind, you have `pacts` there

bethskurrie
2021-01-07 04:50
can-i-deploy users, I'm adding the URLs of the verification results to the output of the can-i-deploy command.

bethskurrie
2021-01-07 04:51
This will allow you go straight to the relevant (failed) result from that output.

bethskurrie
2021-01-07 04:51
This is what I've got so far.

bethskurrie
2021-01-07 04:51
```pact-broker can-i-deploy --pacticipant MyProvider --latest Computer says no ¯\_(?)_/¯ CONSUMER | C.VERSION | PROVIDER | P.VERSION | SUCCESS? | RESULT# ------------|-----------|------------|-----------|----------|-------- MyConsumer | 3 | MyProvider | 2 | true | 1 MyConsumer2 | 1 | MyProvider | 2 | false | 2 MyConsumer3 | 1 | MyProvider | 2 | false | 3 VERIFICATION RESULTS -------------------- 1. http://localhost:9292/pacts/provider/MyProvider/consumer/MyConsumer/pact-version/00b1b6424125436c79369dddaf351313ba811aa8/verification-results/125 (success) 2. http://localhost:9292/pacts/provider/MyProvider/consumer/MyConsumer2/pact-version/85ce3a114c9e247ec97f666ca9bb134380d466e8/verification-results/126 (failure) 3. http://localhost:9292/pacts/provider/MyProvider/consumer/MyConsumer3/pact-version/347d0bdb0888d46b4bdf84009a17f23fc9193165/verification-results/127 (failure) The verification between the latest version of MyConsumer2 (1) and the latest version of MyProvider (2) failed The verification between the latest version of MyConsumer3 (1) and the latest version of MyProvider (2) failed```

bethskurrie
2021-01-07 04:51
The URLS are too long to put in the table, so I'm putting them below.

bethskurrie
2021-01-07 04:52
I'm trying to work out how to make it clear which result belongs to which row. Is that clear enough?

bethskurrie
2021-01-07 04:54
Or maybe: ```CONSUMER | C.VERSION | PROVIDER | P.VERSION | SUCCESS? | RESULT REF ------------|-----------|------------|-----------|----------|----------- MyConsumer | 3 | MyProvider | 2 | true | #1 MyConsumer2 | 1 | MyProvider | 2 | false | #2 MyConsumer3 | 1 | MyProvider | 2 | false | #3 VERIFICATION RESULTS -------------------- #1 http://localhost:9292/pacts/provider/MyProvider/consumer/MyConsumer/pact-version/00b1b6424125436c79369dddaf351313ba811aa8/verification-results/125 (success) #2 http://localhost:9292/pacts/provider/MyProvider/consumer/MyConsumer2/pact-version/85ce3a114c9e247ec97f666ca9bb134380d466e8/verification-results/126 (failure) #3 http://localhost:9292/pacts/provider/MyProvider/consumer/MyConsumer3/pact-version/347d0bdb0888d46b4bdf84009a17f23fc9193165/verification-results/127 (failure)```

bethskurrie
2021-01-07 04:55
or

bethskurrie
2021-01-07 04:55
```CONSUMER | C.VERSION | PROVIDER | P.VERSION | SUCCESS? | RESULT REF ------------|-----------|------------|-----------|----------|----------- MyConsumer | 3 | MyProvider | 2 | true | (1) MyConsumer2 | 1 | MyProvider | 2 | false | (2) MyConsumer3 | 1 | MyProvider | 2 | false | (3) VERIFICATION RESULTS -------------------- (1) http://localhost:9292/pacts/provider/MyProvider/consumer/MyConsumer/pact-version/00b1b6424125436c79369dddaf351313ba811aa8/verification-results/125 (success) (2) http://localhost:9292/pacts/provider/MyProvider/consumer/MyConsumer2/pact-version/85ce3a114c9e247ec97f666ca9bb134380d466e8/verification-results/126 (failure) (3) http://localhost:9292/pacts/provider/MyProvider/consumer/MyConsumer3/pact-version/347d0bdb0888d46b4bdf84009a17f23fc9193165/verification-results/127 (failure)```

brett
2021-01-07 06:29
Here is more of the output when running with --verbose:

brett
2021-01-07 06:29
Moshes-iMac:zayit moshe$ npm run publish --verbose npm info it worked if it ends with ok npm verb cli [ npm verb cli '/usr/local/bin/node', npm verb cli '/usr/local/bin/npm', npm verb cli 'run', npm verb cli 'publish', npm verb cli '--verbose' npm verb cli ] npm info using npm@6.14.8 npm info using node@v12.13.1 npm verb run-script [ 'prepublish', 'publish', 'postpublish' ] npm info lifecycle zayit@0.0.0~prepublish: zayit@0.0.0 npm info lifecycle zayit@0.0.0~publish: zayit@0.0.0 > zayit@0.0.0 publish /Users/moshe/Downloads/Code/zayit > npx pact-broker publish pacts --consumer-app-version=1 --broker-base-url=https://zayit.pactflow.ioredacted] --broker-token=[redacted] --tag master Error making request - NoMethodError undefined method `[]' for nil:NilClass /Users/moshe/Downloads/Code/zayit/node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.3/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.29.1/lib/pact_broker/client/pact_hash.rb:11:in `consumer_name', attempt 1 of 3 Error making request - NoMethodError undefined method `[]' for nil:NilClass /Users/moshe/Downloads/Code/zayit/node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.3/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.29.1/lib/pact_broker/client/pact_hash.rb:11:in `consumer_name', attempt 2 of 3 Error making request - NoMethodError undefined method `[]' for nil:NilClass /Users/moshe/Downloads/Code/zayit/node_modules/@pact-foundation/pact-node/standalone/darwin-1.88.3/pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.29.1/lib/pact_broker/client/pact_hash.rb:11:in `consumer_name', attempt 3 of 3 Failed to tag versions due to error: NoMethodError - undefined method `[]' for nil:NilClass

brett
2021-01-07 06:34
Thanks for the responses! I pasted more of the error output in a new thread not to flood the main chat. But this is the basic backtrace ...Error making request - NoMethodError undefined method `[]' for nil:NilClass ...pact_hash.rb:11:in `consumer_name'

brett
2021-01-07 06:39
@bethskurrie While I can see how options 2 and 3 try to provide additional clarity, I think your current / first option is the cleanest and easiest to look at / parse visually.

bethskurrie
2021-01-07 10:00
Sounds like the consumer node is missing

bethskurrie
2021-01-07 10:01
What is the content of the pact? It looks like there is no consumer key in the json.

matt.fellows
2021-01-07 10:43
Yep, me too

matt.fellows
2021-01-07 10:44
Is it a directory?

matt.fellows
2021-01-07 10:44
It would be strange for the framework to generate a file with the name unless it was manually tampered with

brett
2021-01-07 11:08
I have a pacts folder in the root of my project with this file, which is the output of my pact tests.

brett
2021-01-07 11:09
!!! I just figured it out....

brett
2021-01-07 11:09
I had a few other .json files in the directory, I just removed them and it works!

brett
2021-01-07 11:11
Thanks so much for your help!

brett
2021-01-07 11:32
What's the best way to verify a consumer pact in Pactflow against a Swagger api spec file? I'm trying to use swagger-mock-validator, but auth seems to require username and password (wondering if there is an API token method), and this command gives me an error: ```swagger-mock-validator https://path/to/json/swagger.json https://domain.pactflow.io --provider backend --user USERNAME:PASSWORD``` "VError: Unable to read "https://domain.pactflow.io": Expected 200 but received 401" Auth seems to be failing and I checked the username/password again and they are correct. Any ideas?

matt.fellows
2021-01-07 13:18
Ah yes! I actually started a PR for this but totally forgot about it

matt.fellows
2021-01-07 13:19
Should be easy enough to add the feature, but in the meantime you could just pull down the contract via GET call and pass the local file

carlo
2021-01-07 13:24
has joined #pact-broker

brett
2021-01-07 14:02
Thanks. How do I pass the local file? I tried this: ```swagger-mock-validator https://path/swagger.json pacts/frontend-backend.json --provider backend``` But i get this error: VError: Unable to read "pacts/frontend-backend.json": Invalid URI "pacts/frontend-backend.json"

brett
2021-01-07 14:02
where pacts/frontend-backend.json is the path to the consumer pact from my project directory.

danny.porrello
2021-01-07 16:48
has joined #pact-broker

dawood.abbas
2021-01-08 07:00
has joined #pact-broker

brett
2021-01-09 17:42
I figured out the issue with passing the file, since I added the --provider flag it was expecting the url for my pactflow account, once removed I was able to run it against the local file.

brett
2021-01-09 17:42
How do I get it to update/show the results of the validation on http://pactflow.io?

matt.fellows
2021-01-09 22:08
Well at the moment you can't without manual intervention. You'd need to manually publish verification results

matt.fellows
2021-01-09 22:08
We are working on a Pactflow specific integration for a similar thing so stay tuned there


cksharma122
2021-01-10 17:19
has joined #pact-broker

caiquedpfc
2021-01-11 04:05
has joined #pact-broker

henrik.rudstrom
2021-01-11 18:30
has joined #pact-broker

kflo
2021-01-11 20:05
i am struggling to find where the ?publish verification results? is in the pact broker API, can someone help me out? https://github.com/pact-foundation/pact_broker/blob/master/lib/pact_broker/api.rb

bethskurrie
2021-01-11 20:05
@kflo can you tell me more about what you're doing?

kflo
2021-01-11 20:05
trying to see what the payload for publishing verification results back to the broker looks like


kflo
2021-01-11 20:06
i see: `{success: ?, providerApplicationVersion: ?}`

kflo
2021-01-11 20:06
really what i am trying to figure out is if this endpoint adds tags to the verification results, or if i should be doing that somewhere else

bethskurrie
2021-01-11 20:07
No, it doesn't


bethskurrie
2021-01-11 20:07
You have to make a separate call to create a tag.

bethskurrie
2021-01-11 20:07
Sounds like you're not using one of the standard clients. What problems are you facing?

bethskurrie
2021-01-11 20:08
Here are the docs on creating tags https://docs.pact.io/pact_broker/tags#creating-tags

kflo
2021-01-11 20:08
i?m using the `scala-pact` integration, it seems to publish tags for the consumer side automatically but not for the provider verification side. not sure if that?s intentional or not

kflo
2021-01-11 20:09
(right now it?s just missing the tags from the CI build, the CD build works the same for both ? i.e. i have to explicitly tell the broker to publish the tags on deployment)

bethskurrie
2021-01-11 20:09
Please raise an issue with pact scala for that to be implemented - it should be.

kflo
2021-01-11 20:11
yeah, first i was trying to verify that my setup was correct which led me down this path :slightly_smiling_face:

bethskurrie
2021-01-11 20:11
You can use the pact cli or a manual PUT as a workaround in the meantime. The tags need to be published BEFORE the results however, for the webhooks to kick off properly, so you may have some difficulties.

kflo
2021-01-11 20:12
hm, interesting, good to know

bethskurrie
2021-01-11 20:12
If you don't have any "verificaiton results published" webhooks though, you should be ok to publish the tag afterwards.

kflo
2021-01-11 20:13
i don?t yet, but probably will at some point


kflo
2021-01-11 20:37
maybe this is a good chance for me to try to contribute :slightly_smiling_face:

bethskurrie
2021-01-11 21:28
That would be awesome @kflo

brett
2021-01-12 07:28
Thanks! At this state of my project I'm OK manually publishing the verification results, but how would I do that? Is the link you sent an example for me to infer how to do that? I'm not using any CI at the moment. I'm able to run the swagger-mock-validator to check for incompatibility, but I'm not sure how I can take that output and manually upload it to pactflow to benefit from the much nicer UI to track and see the incompatibilities. What do you suggest?

matt.fellows
2021-01-12 07:57
I'm not sure if we have an API that will let you report the specific failures that's not specific to Pact itself. We are working on one for this exact scenario, so I'd hold tight in doing any custom work

matt.fellows
2021-01-12 07:58
And yes, the example I showed you is how to retrieve the link to publish verification results and how to send a message to it

matt.fellows
2021-01-12 07:58
Basically, we just want to report whether it passed/failed

brett
2021-01-12 08:08
Thanks. What do you mean by "I'm not sure if we have an API that will let you report the specific failures *that's not specific to Pact itself*." Isn't the output below of swagger-mock-validator specific to Pact? > swagger-mock-validator https://<someUrl>/swagger.json pacts/frontend-backend.json Mock file "pacts/frontend-backend.json" is not compatible with spec file "https://<someUrl>/swagger.json" 19 error(s) request.path-or-method.unknown: 5 request.body.incompatible: 7 response.body.incompatible: 7 0 warning(s) {... [goes on to show specific errors]

matt.fellows
2021-01-12 09:11
The swagger mock validator is a tool written by atlassian and shows differences between a pact file and an OAS

matt.fellows
2021-01-12 09:12
The verification results screen in Pactflow has no idea about those errors. It only knows about the failures pact can determine, and the format to parse and render them

matt.fellows
2021-01-12 09:15
Does that make sense? You could probably still upload the output and see what happens tho. At the very least, you could probably use the HAL browser later on to view the raw results, but I don't know if the Pact screen will display anything

eric
2021-01-12 10:23
has joined #pact-broker

brett
2021-01-12 11:51
Thanks for the additional explanation. So basically, the Pactflow UI verification is designed for showing verification results when comparing consumer pacts to provider pacts results, and the swagger-mock-validator compares the consumer pact to an OAS, which is not something Pactflow deals with. Is that correct? So in my project, I should focus on getting the provider tests to produce the provider pact file to upload to Pactflow so that it can compare the consumer to provider results, and then I will be able to use the Pactflow UI for targeting the inconsistencies, right?

matt.fellows
2021-01-12 23:53
> Thanks for the additional explanation. So basically, the Pactflow UI verification is designed for showing verification results when comparing consumer pacts to provider pacts results, and the swagger-mock-validator compares the consumer pact to an OAS, which is not something Pactflow deals with. Is that correct? That?s correct. @bethskurrie may have more to say on the above.

matt.fellows
2021-01-12 23:54
> So in my project, I should focus on getting the provider tests to produce the provider pact file to upload to Pactflow so that it can compare the consumer to provider results, and then I will be able to use the Pactflow UI for targeting the inconsistencies, right? I think you mean *provider verification results* (there is no provider _pact_ file, as such). This is of course up to you, and depends on why you want to use the OAS validator in the first place.

matt.fellows
2021-01-12 23:55
There are two reasons I think to use the atlassian tool on the provider side: 1. As a replacement for a provider pact test (on the assumption you do indeed guarantee your provider implements the OAS file). This is a legitimate approach and is something we?re actively looking to build in to Pactflow right now 2. As an additional check on the provider, to ensure that all of your documentation and implementation is in alignment. In this case, you?d still need to do the pact provider verification step

matt.fellows
2021-01-12 23:56
If you?re going down (1), then you could use the example I shared with you to report back to Pactflow the results of the swagger-mock-validator call (pass/fail, along with the specific output)

matt.fellows
2021-01-12 23:56
If you did this, then you would still be able to use the `can-i-deploy` and other Pactflow/Pact Broker related tools

fnguyen
2021-01-13 00:39
has joined #pact-broker

brett
2021-01-13 07:34
I really appreciate your assistance. Your explanations continue to be very helpful. Yes, I'm looking to go down (1), because I'm currently much more TDD-inclined than the developer working on the provider side and the swagger spec is automatically updated when he makes changes to the provider. So until he gets provider tests up and running to run my pact file against his provider tests, verifying against the swagger spec is an improvement.

brett
2021-01-13 07:39
Regarding the code you pointed me to, since I'm not using any CI, and I'm running the swagger mock validator manually, would I just do a curl based on this syntax (updating the params accordingly)? curl -X POST ${CONTENT_TYPE_HEADER} ${AUTH_HEADER} $$RESULTS_URL -d '{ "success": false, "providerApplicationVersion": "${TRAVIS_COMMIT}" }'; \ And I understand that while the UI would not update to show the errors, if I include the verification output from the swagger mock validator tool in my curl, that output should be viewable in the HAL Browser?

matt.fellows
2021-01-13 10:17
yep, exactly!

sagupta
2021-01-13 16:00
Hello people, Is there a way to check the difference between contracts? I am trying to debug a pipeline failure which got triggered because of contract changed so i wanted to know what exactly is changed in the contract compared to a previous version

pollet_22
2021-01-13 16:04
has joined #pact-broker

phil.endsley
2021-01-13 16:09
```/pacts/provider/[pacticipant]/consumer/[pacticipant]/pact-version/[pactVersion1]/diff/pact-version/[pactVersion2]``` This will give you a diff between two pact versions. You can use the build in HAL client from Broker to explore this as well. From the broker's ui, go to a contract, then click on View in API Browser. You can use pb:diff-previous-distinct or pb:diff

phil.endsley
2021-01-13 16:10
Note that pactVersion for that url is not the version published with the consumer/provider, but the version of the pact itself

dshattuck
2021-01-13 20:49
has joined #pact-broker

thomas.rosati
2021-01-13 21:58
has joined #pact-broker

rahulsmalpani
2021-01-14 07:56
has joined #pact-broker

sacha.camfferman768
2021-01-14 09:42
has joined #pact-broker

sagupta
2021-01-14 10:04
Hello Phil, I am currently trying out the solution in HAL browser and i am not sure what to exactly put for the version

sagupta
2021-01-14 10:05
since from the pact matrix , i could only see 2 pacts with different consumer/provider versions (in this case different consumer/provider SHA)

phil.endsley
2021-01-14 17:22
Yeah, you need to use the api browser again. 1. View in API browser like above 2. *pb:all-pact-versions* 3. *Select the version you want* 4. *pb:pact-version*

sagupta
2021-01-14 17:23
Ah alright let me try that

brandonbeard86
2021-01-14 22:10
has joined #pact-broker

geetishnayak
2021-01-15 01:02
has joined #pact-broker

shettyg
2021-01-15 14:18
has joined #pact-broker

natarajang1
2021-01-15 15:29
has joined #pact-broker

irldev
2021-01-15 22:35
If we have two different versions of a contract on a broker, for example version 1 on production and version 2 on development. Is there an easy way for a provider to verify against one of those without having to specify the version number they are looking to verify against? When running our provider verification in CI, we don't want to have to constantly change and specify the version number of the contract to run provider verification against.

matt.fellows
2021-01-15 22:40
You want to use tags

matt.fellows
2021-01-15 22:40
There are heaps of docs on this, so I'll leave it to you

matt.fellows
2021-01-15 22:41
I'd also look at the cicd workshop in howtolearn

2021-01-15 22:41
Here are a number of useful hands-on labs that teach all of the key concepts https://docs.pact.io/implementation_guides/workshops


michel.neufeglise
2021-01-18 08:55
has joined #pact-broker

bart.boersma
2021-01-18 10:48
has joined #pact-broker

wilkinsweiqiangliang
2021-01-18 22:55
Hi team, i wonder what is the recommended process for a feature branch PR merged into master in `pact consumer`. Is there any document for reading?


wilkinsweiqiangliang
2021-01-18 22:55
i think so, i will had another read


wilkinsweiqiangliang
2021-01-18 22:56
thanks

wilkinsweiqiangliang
2021-01-18 23:13
`consumerVersionSelectors: [{ tag: 'master', latest: true }`

wilkinsweiqiangliang
2021-01-18 23:13
do we always need the latest?

bethskurrie
2021-01-18 23:13
yes

wilkinsweiqiangliang
2021-01-18 23:13
is there for feature branch verification result?

bethskurrie
2021-01-18 23:13
have you read about tags? https://docs.pact.io/pact_broker/tags

wilkinsweiqiangliang
2021-01-18 23:14
i had, i think i upgrade the old way to a new way of writing the tag

bethskurrie
2021-01-18 23:14
I think these questions would be answered by doing the CI/CD workshop. Are you sure you've done it, not just read it?

wilkinsweiqiangliang
2021-01-18 23:15
had done it, and my flow works well till today

wilkinsweiqiangliang
2021-01-18 23:15
i realise one of the feature branch doesnt have verification result


monica.wu
2021-01-19 06:25
has joined #pact-broker

makobernal
2021-01-19 08:23
has joined #pact-broker

jibrail.idris
2021-01-19 10:11
has joined #pact-broker

jmvb.registros
2021-01-19 11:01
has joined #pact-broker

arindam.datta
2021-01-19 11:32
Any Azure Devops expert here! Webhook to queue a build is getting failed with status `302`

arindam.datta
2021-01-19 11:32
Used PAT token

arindam.datta
2021-01-19 11:32
The PAT token is working, tried from a Console application.

arindam.datta
2021-01-19 11:33
Tried specifying PAT token here

arindam.datta
2021-01-19 11:42
Please ignore above... found that I had to specify the Base64 encoded string as token

kjayachandra2000
2021-01-19 11:49
Hi All, for pact broker oss can we have multiple user account apart from base authentication?

matt.fellows
2021-01-19 12:30
No, the OSS pact broker doesn't have any concept of user. You'd have to add your own

mateusz.derks
2021-01-19 13:56
Hey again :wave: after a quiet December we finally updated pact broker to 2.73 and we enjoy WIP pacts with the tweaks to pact URL pushed in webhook. I?m trying to get to the bottom of one issue and I?m wondering if it?s something you encountered already. When we ask the broker about contracts for verification we see duplicates in the log. From the further entries it appears that all of them belong to a different version (feature branches) that do not change contract on their own, they just publish a contract identical to another legit WIP branch. ```14:09:27 INFO: Reading pact at .../pacts/provider/Provider/consumer/Consumer/pact-version/123/metadata/d2lwPXRydWU= 14:09:28 INFO: Reading pact at .../pacts/provider/Platform/consumer/Consumer/pact-version/123/metadata/d2lwPXRydWU= 14:09:28 INFO: Reading pact at .../pacts/provider/Platform/consumer/Consumer/pact-version/123/metadata/d2lwPXRydWU=``` So far I can?t reproduce this issue outside of our project. Do you have some ideas why it could happen?

sagupta
2021-01-19 17:01
Hello Team, Is there any way to run provider test against a specific consumer and a specific tag? I am currently using the `verify` from pact-cli on the provider side and couldnt find a flag to pass consumer name. It only has consumer-version-selectors .

brett
2021-01-19 19:40
I noticed that extra properties on the response were not triggering verification errors. I then found in the docs that this is expected behavior: "Note that during provider verification, following Postel's Law of being "relaxed" with what we accept, "unexpected" values in JSON response bodies are ignored. This is expected and is perfectly OK. Another consumer may have an expectation about that field." (docs) In my case we discovered some fields in the database that were no longer relevant and we thought the tests would pick that up (but they don't because all other properties are present). Is there any good way to confirm that the response doesn't have any unexpected properties?

tpham
2021-01-19 22:36
has joined #pact-broker

matt.fellows
2021-01-19 22:40
Not that I'm aware of. There are other tools that can do this (e.g. some of the OAS/swagger)

bheemreddy181
2021-01-19 23:23
Team any idea why do we see these errors while publishing results to pact broker ``` Error returned from verification results publication 500 (Pact::Provider::VerificationResults::PublicationError)\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/pact-1.55.6/lib/pact/provider/verification_results/publish.rb:35:in```

bheemreddy181
2021-01-19 23:31
We are seeing this error on PACT-Go version v1.5.1 while publishing results to the broker from provider

matt.fellows
2021-01-19 23:53
Self hosted broker or Pactflow? If self-hosted, what do the logs say about it? There should be a stack trace containing the source of the problem

matt.fellows
2021-01-19 23:53
I think I?ve seen problems in the past, where the version or tag contains a newline. I think that?s fixed in latest versions of the broker and client libraries, but just in case it?s worth checking

matt.fellows
2021-01-19 23:53
If you could share the code samples, that might help

bheemreddy181
2021-01-20 00:00
Looks like is it a different issue - this what our developer shared how it got fixed ```we added a scenario for a publisher api that returns base64 encoded pdf response (about 128kb of data). The pact client failed to upload the results with 500 response code and empty body.``` once we removed the PDF file it worked fine

matt.fellows
2021-01-20 00:01
interesting.

matt.fellows
2021-01-20 00:01
To Pactflow or your own hosted one?

matt.fellows
2021-01-20 00:02
it?s possible that the payload is too big (although that doesn?t seem too big at first glance, I?ve heard of MBs of pact files being uploaded before)

matt.fellows
2021-01-20 00:16
I?d be keen to see the log for that, because it sounds like a bug

bheemreddy181
2021-01-20 00:30
hosted one

bheemreddy181
2021-01-20 00:30
i felt the same

bheemreddy181
2021-01-20 00:30
logs from pact broker itself ?

bheemreddy181
2021-01-20 00:32
I don't think we are emitting logs from pact broker into splunk or something we need to do that

bheemreddy181
2021-01-20 00:33
```021/01/19 23:48:20 [DEBUG] executing after hook 2021/01/19 23:48:20 [DEBUG] teardown pact.go:413: No pacts found to verifify. Check the tags provided (master) for your broker (https://pact-broker.enova.com) are correct contract_test.go:90: Error Trace: contract_test.go:90 Error: Expected nil, but got: &errors.errorString{s:"error verifying provider: exit status 1\n\nSTDERR:\n/home/circleci/project/pact/lib/ruby/lib/ruby/gems/2.2.0/gems/bundler-1.9.9/lib/bundler/shared_helpers.rb:78: warning: Insecure world writable dir /go/bin in PATH, mode 040777\nINFO: Fetching pacts for sysopen_gateway from https://pact-broker.enova.com with the selection criteria: latest for tag master\nINFO: Reading pact at https://pact-broker.enova.com/pacts/provider/sysopen_gateway/consumer/brazil_frontend/pact-version/099acef1aea04e3b57affe0c5db5a9453aa2fca2\nINFO: Tagging version 08994a7e8d71a6156b3714fbed25d0e3bb0af48f of sysopen_gateway as \"braz2872\"\n/home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/pact-1.55.6/lib/pact/provider/verification_results/publish.rb:103:in `publish_verification_results': Error returned from verification results publication 500 (Pact::Provider::VerificationResults::PublicationError)\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/pact-1.55.6/lib/pact/provider/verification_results/publish.rb:35:in `call'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/pact-1.55.6/lib/pact/provider/verification_results/publish.rb:21:in `call'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/pact-1.55.6/lib/pact/provider/verification_results/publish_all.rb:22:in `block in call'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/pact-1.55.6/lib/pact/provider/verification_results/publish_all.rb:19:in `collect'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/pact-1.55.6/lib/pact/provider/verification_results/publish_all.rb:19:in `call'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/pact-1.55.6/lib/pact/provider/verification_results/publish_all.rb:10:in `call'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/pact-1.55.6/lib/pact/provider/rspec/pact_broker_formatter.rb:28:in `close'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.10.0/lib/rspec/core/reporter.rb:209:in `block in notify'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.10.0/lib/rspec/core/reporter.rb:208:in `each'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.10.0/lib/rspec/core/reporter.rb:208:in `notify'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.10.0/lib/rspec/core/reporter.rb:243:in `close'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.10.0/lib/rspec/core/reporter.rb:196:in `close_after'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.10.0/lib/rspec/core/reporter.rb:174:in `finish'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.10.0/lib/rspec/core/reporter.rb:76:in `report'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.10.0/lib/rspec/core/runner.rb:115:in `run_specs'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.10.0/lib/rspec/core/runner.rb:89:in `run'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/rspec-core-3.10.0/lib/rspec/core/runner.rb:71:in `run'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/pact-1.55.6/lib/pact/provider/pact_spec_runner.rb:90:in `run_specs'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/pact-1.55.6/lib/pact/provider/pact_spec_runner.rb:35:in `run'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/pact-1.55.6/lib/pact/cli/run_pact_verification.rb:70:in `run_with_pact_uri_object'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/pact-1.55.6/lib/pact/cli/run_pact_verification.rb:51:in `run_specs'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/pact-1.55.6/lib/pact/cli/run_pact_verification.rb:21:in `call'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/pact-1.55.6/lib/pact/cli/run_pact_verification.rb:13:in `call'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/app.rb:171:in `verify_pact'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/app.rb:43:in `block in call'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/app.rb:42:in `collect'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/app.rb:42:in `call'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/app.rb:34:in `call'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/cli/verify.rb:47:in `verify'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'\n\tfrom /home/circleci/project/pact/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.32.1/lib/pact/provider_verifier/cli/custom_thor.rb:17:in `start'\n\tfrom /home/circleci/project/pact/lib/app/pact-provider-verifier.rb:33:in `<main>'\n\n\nSTDOUT:\n"}```

bheemreddy181
2021-01-20 00:33
this is what i see in the CI

matt.fellows
2021-01-20 00:36
Yeah, unfortunately that won?t show the error in the broker itself, which is likely hidden from the external interface

matt.fellows
2021-01-20 00:38
You?ll need somebody to fetch the logs I?m afraid

bheemreddy181
2021-01-20 02:15
Will ask them emit logs out so they are handy

bheemreddy181
2021-01-20 02:15
I will share them once I have

vishal.grover
2021-01-20 03:12
has joined #pact-broker

priya.saraf
2021-01-20 08:43
has joined #pact-broker

fahad.aj.khan
2021-01-20 08:58
has joined #pact-broker

nicole.jaenchen
2021-01-20 09:38
has joined #pact-broker

brett
2021-01-20 10:04
Thanks for the feedback! I will explore there.

dinakaran.ulaganathan
2021-01-20 13:59
has joined #pact-broker

ptsiakos77
2021-01-20 21:55
has joined #pact-broker

bethskurrie
2021-01-20 22:46
@bheemreddy181 the client should put out the error text for you. I'll have a look at that.

bheemreddy181
2021-01-20 22:46
you mean pact broker client ?

bethskurrie
2021-01-20 22:46
yes

bethskurrie
2021-01-20 22:47
it should show you the body of the response with an error reference for you to search for in your logs

bethskurrie
2021-01-20 23:00
@bheemreddy181 I'm confused as to why you aren't seeing the body of the error response in the logs

bethskurrie
2021-01-20 23:00
This is what I get when I force an error during a verification publication

bethskurrie
2021-01-20 23:00
```Pact::Provider::VerificationResults::PublicationError: Error returned from verification results publication 500 {"error"=>{"message"=>"bethtest", "reference"=>"bCJRhpdHsD", "backtrace"=>["/Users/bethanyskurrie/workspace/pact-foundation/pact_broker/lib/pact_broker/api/resources/verifications.rb:53:in `from_json'"```

bethskurrie
2021-01-20 23:00
It puts the response body in after the "500".

bethskurrie
2021-01-20 23:01
I can see that there is a space after the 500 in your error logs.

bethskurrie
2021-01-20 23:01
```Error returned from verification results publication 500 (```

bethskurrie
2021-01-20 23:01
Between the `500` and the `(`

bethskurrie
2021-01-20 23:01
That says to me that the 500 is coming back with an empty response body, and I don't see how that could happen from the Ruby code.

bethskurrie
2021-01-20 23:02
Is it possible that a 500 is coming back from an intermediate server (ie. do you have ngnix in front of it?)

bethskurrie
2021-01-20 23:05
You'll be able to tell if the response was from the Ruby server if you turn on --verbose (you'll have to look at the docs of your verifier for how to do that).

bethskurrie
2021-01-20 23:05
In the output you'll see ```-> "Server: Webmachine-Ruby/1.5.0 Rack/1.3\r\n" -> "X-Pact-Broker-Version: 2.74.1\r\n"```

bethskurrie
2021-01-20 23:06
in the logs for the `POST /pacts/provider/Bar/for-verification` request

bheemreddy181
2021-01-20 23:10
I assume we have ngnix in front of that, it was weird that didn't see any syslogs as well , do i need to explicitly emit out logs from the docker image of pact broker

bethskurrie
2021-01-20 23:10
no, they just happen.

bethskurrie
2021-01-20 23:11
you'll need to configure what ever tool you're hosting it in to forward them to something.

bheemreddy181
2021-01-20 23:31
makes sense


bethskurrie
2021-01-20 23:40
@mateusz.derks can you provide all the logs from that scenario?

bethskurrie
2021-01-20 23:41
it's v strange that you would be getting the same pact version mulitple times because it should be de-duplicated. Sounds like a bug to me.

bheemreddy181
2021-01-21 00:33
So latest Open Source Version of pact broker doesn't allow you to delete PACTS ?

bethskurrie
2021-01-21 00:34
what makes you say that?

bheemreddy181
2021-01-21 00:35
older version of the UI used to allow people to delete PACTS from the UI , i should have phrased it correctly on my initial statement

bethskurrie
2021-01-21 00:35
it should still be supported.

bethskurrie
2021-01-21 00:36
I did to an upgrade of bootstrap, so that may have introduced a regression.

bethskurrie
2021-01-21 00:36
I do remember testing that though.

bethskurrie
2021-01-21 00:36
Can you do a hard refresh of your page to make sure you have the latest js/css please.

bheemreddy181
2021-01-21 00:36
i don't see that as an option in the latest image

bheemreddy181
2021-01-21 00:37
Sorry a Incognito mode worked

bheemreddy181
2021-01-21 00:38
So is there any specific reason why we have this option in the initial phase itself ?

bethskurrie
2021-01-21 00:38
I don't understand the question

bheemreddy181
2021-01-21 00:39
i mean why was this an option from the start , just curious to know from design point of view

bethskurrie
2021-01-21 00:39
Why was what an option?

bheemreddy181
2021-01-21 00:39
Deleting PACTS from UI

bethskurrie
2021-01-21 00:39
You're asking me why it is supported?

bheemreddy181
2021-01-21 00:40
yes

bheemreddy181
2021-01-21 00:40
more like why it was designed this way

bethskurrie
2021-01-21 00:41
Because people want to be able to delete pacts through the UI.

bheemreddy181
2021-01-21 00:41
Given we have API's to do it i feel this feature will give an ability to mess with other services pacts

bheemreddy181
2021-01-21 00:42
but ya its not a big deal as long as people are matured enough to know that they shouldn't mess with these

bethskurrie
2021-01-21 00:42
Anyone can delete it through the API too.

bethskurrie
2021-01-21 00:42
If you want permissions and role/team based security, then you can use Pactflow OnPremise.

bheemreddy181
2021-01-21 00:42
ya makes sense

matt.fellows
2021-01-21 01:44
Deleting a pact can be useful, because occasionally a bad contract is published or incorrectly tagged. This can result in verification failures and blocked pipelines, so being able to delete a specific version of a pact can get you out of that bind (amongst other uses cases of course)

matt.fellows
2021-01-21 01:44
As Beth mentioned, it was asked enough by the community that it was added - that?s usually how things make it in there!

matt.fellows
2021-01-21 01:45
One thing you can almost 100% assume about Pact functionality - it was built to solve a problem for somebody (often a maintainer)

mhdtouban
2021-01-21 01:58
has joined #pact-broker

bethskurrie
2021-01-21 02:13
@mateusz.derks can you see if you can reproduce it using my little HTTP test data builder? https://github.com/pact-foundation/pact_broker/blob/master/ISSUES.md

veeraprathap.n
2021-01-21 04:10
has joined #pact-broker

mateusz.derks
2021-01-21 09:03
I lost access to logs, the affected CI job was cleaned up due to retention settings. I will share the full log once I see the issue again. I will try to reproduce the problem with the tool you mentioned, thanks :bow:

tsiakos
2021-01-21 09:24
has joined #pact-broker

sagupta
2021-01-21 09:45
ok so when using CLI , how can i pass the consumer name. ```pact/entrypoint.sh verify \ --pact-broker-base-url=${PACT_BROKER_URL} \ --provider-base-url=${PROVIDER_BASE_URL} \ --provider=${PACT_PROVIDER} \ --provider-version-tag=${PACT_PROVIDER_TAG} \ --provider-app-version=${PROVIDER_VERSION}``` Currently i pass only the consumer tag with this flag in above script ```--consumer-version-tag=${CONSUMER_TAG}```

oleg
2021-01-21 13:05
has joined #pact-broker

patrick.hendron
2021-01-21 17:30
~Heys guys im trying to run the test broker on my local~

patrick.hendron
2021-01-21 17:32
Hey guys looking to run the test broker on my local, I have followed the instruction step by step ```Install ruby 2.2.0 or later and bundler >= 1.12.0 Windows users: get a Rails/Ruby installer from RailsInstaller and run it unix users just use your package manager Run git clone git@github.com:pact-foundation/pact_broker.git && cd pact_broker/example Run bundle install```

patrick.hendron
2021-01-21 17:33
then when i run - `bundle exec rackup -p 9292 -o 0.0.0.0` the following returns ```bundler: failed to load command: rackup (/usr/local/lib/ruby/gems/3.0.0/bin/rackup) /usr/local/lib/ruby/gems/3.0.0/gems/dry-types-0.10.3/lib/dry/types/definition.rb:33:in `initialize': wrong number of arguments (given 3, expected 1..2) (ArgumentError)```

patrick.hendron
2021-01-21 17:34
Versions running : `Bundler version 2.2.6 ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin19]`

patrick.hendron
2021-01-21 18:20
downgraded my ruby version from 3.0.0 to 2.2.4 and its now working

bethskurrie
2021-01-21 22:17
@patrick.hendron yeah, the build isn't passing on 3.0.0 yet. Stick to 2.7.

bethskurrie
2021-01-21 23:51
@patrick.hendron we strongly recommend people use docker in preference to running the Ruby app themselves. Are you unable to do this?

thomas.powell
2021-01-22 10:18
has joined #pact-broker

patrick.hendron
2021-01-22 10:46
yeah, i have got burnt using ruby :joy:, switching to docker currently

patrick.hendron
2021-01-22 10:47
thanks for your help beth!

jstoebel
2021-01-22 17:12
Hello, I am working with my team to set up a POC of contract testing and my team lead was curious about spinning up a pact broker inside of our CI server during test runs. Instances of the pact broker would then talk to an external, always available database somewhere else. Are there any pitfalls with this? I can't think of a reason why that wouldn't work, but being new to contract tests I wanted to see if anyone could spot any problems with this approach.

brendan.donegan
2021-01-22 18:46
what if you want to check anything about the contracts between builds?

brendan.donegan
2021-01-22 18:46
The broker is a very useful resource we find

brendan.donegan
2021-01-22 18:46
Is this meant to be a cost-saving method?

jstoebel
2021-01-22 19:09
@brendan.donegan ahh this is a very good point! contracts are also a form of documentation! I think the concern is what team will be in charge of ensuring the pact broker's availability. basically he's trying to emulate the serverless model which is what we are trying to migrate to for everything else.

bethskurrie
2021-01-22 23:39
There is a serverless broker available, but it's experimental and doesn't support webhooks yet @jstoebel

bethskurrie
2021-01-22 23:40
Typically, you want it up and running at all times. Lots of CI jobs will be running and accessing it at the same time, in a normal environment. Stopping and starting it all the time would get messy.

bethskurrie
2021-01-22 23:41
My guess is the time spent on dealing with complications involved for such an unusual set up would outweigh any cost savings for the resources.

bethskurrie
2021-01-22 23:42
The broker is an organisational concern, not a team concern.

bethskurrie
2021-01-22 23:43
Which team runs Jira? Which team runs your enterprise Github? (Hypothetically). The same one would run the broker.

stefan.selent
2021-01-23 01:54
has joined #pact-broker

mateusz.derks
2021-01-25 08:06
I found this in the logs, all they point to the same contract URL ```08:19:25 DEBUG: The pact at https://BROKER/pacts/provider/PROVIDER/consumer/CONSUMER/pact-version/a9f75f7f035e0fcdf86f82200c07cbbc8f808257/metadata/d2lwPXRydWU= is being verified because it is a 'work in progress' pact (ie. it is the pact for the latest version of Consumer tagged with 'feat-1' and is still in pending state) 08:19:25 DEBUG: The pact at https://BROKER/pacts/provider/PROVIDER/consumer/CONSUMER/pact-version/a9f75f7f035e0fcdf86f82200c07cbbc8f808257/metadata/d2lwPXRydWU= is being verified because it is a 'work in progress' pact (ie. it is the pact for the latest version of Consumer tagged with 'feat-2' and is still in pending state) 08:19:25 DEBUG: The pact at https://BROKER/pacts/provider/PROVIDER/consumer/CONSUMER/pact-version/a9f75f7f035e0fcdf86f82200c07cbbc8f808257/metadata/d2lwPXRydWU= is being verified because it is a 'work in progress' pact (ie. it is the pact for the latest version of Consumer tagged with 'master' and is still in pending state)```

paulo
2021-01-25 11:37
has joined #pact-broker

jstoebel
2021-01-25 14:36
This is really helpful. Thank you!

kmckeever
2021-01-25 14:38
has joined #pact-broker

mateusz.derks
2021-01-25 14:54
I probably misunderstand something, I tried to produce a WIP contract, but this returns only 1 pact to verify ```td.delete_integration(consumer: "foo-consumer", provider: "bar-provider") .publish_pact(consumer: "foo-consumer", consumer_version: "1", provider: "bar-provider", content_id: "111", tag: "production") .publish_pact(consumer: "foo-consumer", consumer_version: "2", provider: "bar-provider", content_id: "112", tag: "main") .get_pacts_for_verification( enable_pending: true, provider_version_tag: "main", include_wip_pacts_since: "2020-01-01", consumer_version_selectors: [{ tag: "production", latest: true }])```

mateusz.derks
2021-01-25 15:01
Ok, I need to verify first and only then publish another contract

mateusz.derks
2021-01-25 15:17
@bethskurrie I managed to reproduce the issue https://github.com/pact-foundation/pact_broker/issues/374

robert.land
2021-01-25 19:25
has joined #pact-broker

aparnachaudhari
2021-01-25 21:34
has joined #pact-broker

gwhill7
2021-01-25 23:23
has joined #pact-broker

anastasiia.bielik
2021-01-26 13:26
Hello, I have a question about `can-i-deploy` command. Right now we run it in such way: ``` --pacticipant 'X' \ --version ${{ github.sha }} \ --pacticipant 'Y' \ --latest production \ --pacticipant 'Z' \ --latest production \``` Our consumer is `X` and `Y` , `Z` are providers. But `Y` is also a consumer, so this check includes unnecessary combination of `consumer:Z -> provider: Y` . Is there a way to verify only the list of providers? I also find another option to use `--to prod` . But we need to check only few providers, not all of them. Is there a way to skip a participant?

bibinc99
2021-01-26 14:37
has joined #pact-broker

anastasiia.bielik
2021-01-26 15:15
We found a workaround: we run `can-i-deploy` for each provider separately. But maybe there you can help to find more elegant way?

phil.endsley
2021-01-26 15:22
You mentioned there were some unnecessary checks happening. Listing each pacticipant, `consumer:Z -> provider:Y` and for using `--to prod` you only need to check some providers. I'm just curious why you don't want to check all combinations?

anastasiia.bielik
2021-01-26 15:31
@phil.endsley yeah, it totally makes sense, but currently we have one provider which was set up for the testing purpose while we are migrating to another architecture.

anastasiia.bielik
2021-01-26 15:31
so if we run all combinations, it will produce failures

sagupta
2021-01-26 17:19
Hello Team, I am facing an error while publishing pacts to broker but do not get clear error . I am using pact-cli and calling `publish` command as below. Can someone help. Is there a way to get more info about error? ```Publishing <-------> pact to pact broker at https://<URL> Failed to publish graphql/<--provider--> pact due to error: PactBroker::Client::Error - One or more pacts failed to be published``` I used this command ```/pact # ./entrypoint.sh publish /opt/contracts/pacts --consumer-app-version=${PA CT_CONSUMER_VERSION} --broker-base-url=${PACT_BROKER_URL} ```

sagupta
2021-01-26 17:29
ok , this :point_up: was happening on CI but when i run locally using the pact json and trying to publish it , i got this error. ```Failed to publish graphql/email-action-api pact due to error: PactBroker::Client::Error - This is the first time a pact has been published for "email-action-api". The name "email-action-api" is very similar to the following existing consumers/providers: * email-action If the pact is intended to be for a new consumer or provider, please manually create "email-action-api" using the following command, and then re-publish the pact:```

kflo
2021-01-26 17:41
generally you only need: `pact-broker can-i-deploy --pacticipant PACTICIPANT --version VERSION --to STAGE` because the pact broker internally knows all the dependencies for the given PACTICIPANT, so you don?t have to specify them all


sagupta
2021-01-26 19:01
I cant find error on CI. It doesnt show full error

sagupta
2021-01-26 19:01
Any way to check this on CI?

matt.fellows
2021-01-26 21:35
Sounds like a question for whoever runs your CI. Pact clearly shows the error

bheemreddy181
2021-01-26 22:41
looks like the Github status checks are broken in the latest pact broker , the success status check is overriding the pending status check , we are seeing both on the PR

bethskurrie
2021-01-26 22:41
Please raise an issue with the detailed steps to reproduce.

bheemreddy181
2021-01-26 22:42
sure

luisc.barretog
2021-01-27 00:42
has joined #pact-broker

bheemreddy181
2021-01-27 02:18
Team we are trying to revert to the older version from 2.76 to 2.54 of pact broker docker image and see the below error ```pact_broker_1 | ! Unable to load application: Sequel::Migrator::Error: Applied migration files not in file system``` Any pointers on this ?

bheemreddy181
2021-01-27 02:22
```Jan 27 02:11:46 test-infrastructure-pactbroker-production.ip-10-112-9-224 docker-compose[20002]: pact_broker_1 | ! Unable to load application: Sequel::Migrator::Error: Applied migration files not in file system Jan 27 02:11:46 test-infrastructure-pactbroker-production.ip-10-112-9-224 docker-compose[20002]: pact_broker_1 | bundler: failed to load command: puma (/pact_broker/vendor/bundle/ruby/2.6.0/bin/puma) Jan 27 02:11:46 test-infrastructure-pactbroker-production.ip-10-112-9-224 docker-compose[20002]: pact_broker_1 | Sequel::Migrator::Error: Applied migration files not in file system: 20200922_add_event_to_trigge```

sagupta
2021-01-27 09:21
Pact shows the error on Ci but it misses the message after ::Client::Error on CI

sagupta
2021-01-27 09:21
this makes it much harder to debug

sagupta
2021-01-27 09:22
And on local if I try to run it shows the error message

yann.courtel
2021-01-27 10:16
Hi everyone, is the version 2.76 stable ? We are about to upgrade our pact broker and want to make sure the image is good. Thanks a lot.

laxmi.somni508
2021-01-27 10:27
has joined #pact-broker

maciej.olko
2021-01-27 10:43
Hi, I?ve recently upgraded and all looks fine for now.

matt.fellows
2021-01-27 10:46
Yes, but my point is it must be some artifact about your CI - clearly pact can show the error.

matt.fellows
2021-01-27 10:46
You need to find out what your CI is doing with the output. Pact can't fix your CI magically

sagupta
2021-01-27 10:49
Ok if I understand it right . Then pact is generating the error message ( after the ::Client::Error -) but the CI may not be showing it or ignoring it .It can be checked in CI logs or artifacts

sagupta
2021-01-27 10:50
One thing I have tried is this : I entered in the shell of CI job and run the command inside shell .I get the same error without the error message

matt.fellows
2021-01-27 11:15
can you please provide evidence of this? It could be a bug, but seems unlikely if it works locally

matt.fellows
2021-01-27 11:25
Hi Bheem

matt.fellows
2021-01-27 11:26
hmmm, my guess is that because later migrations have applied, rolling back the image can?t perform a DB rollback, because the migration files aren?t present on the newer image, and therefore it doesn?t know how to roll them back (because the rollback instructions are in the newer image)


matt.fellows
2021-01-27 11:29
I think it should be OK though. Just start back up the `2.76`, do the DB migration, and then run the old image as per the instructions there

matt.fellows
2021-01-27 11:29
why do you need to rollback though?

sagupta
2021-01-27 12:28
Let me send you via pm

bheemreddy181
2021-01-27 13:49
We are seeing issues with GitHub status checks


ryanding16
2021-01-27 20:25
has joined #pact-broker

bheemreddy181
2021-01-28 05:31
We couldn?t rollback as per the documentation mentioned above , logs for reference `/pact_broker # bundle exec rake pact_broker:db:migrate[20200319] bundler: failed to load command: rake (/usr/local/bundle/bin/rake) Gem::Exception: can't find executable rake for gem rake. rake is not currently included in the bundle, perhaps you meant to add it to your Gemfile? /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/rubygems_integration.rb:460:in `block in replace_bin_path' /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/rubygems_integration.rb:480:in `block in replace_bin_path' /usr/local/bundle/bin/rake:23:in `<top (required)>' /pact_broker # ls /usr/local/bin/ bundle bundler erb gem irb rake rdoc ri ruby /pact_broker # PATH=/usr/local/bin/:$PATH /pact_broker # bundle exec rake pact_broker:db:migrate[20200319] bundler: failed to load command: rake (/usr/local/bin/rake) Gem::Exception: can't find executable rake for gem rake. rake is not currently included in the bundle, perhaps you meant to add it to your Gemfile? /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/rubygems_integration.rb:460:in `block in replace_bin_path' /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/rubygems_integration.rb:480:in `block in replace_bin_path' /usr/local/bin/rake:23:in `<top (required)>' /pact_broker # bundle exec /usr/local/bin/rake bundler: failed to load command: /usr/local/bin/rake (/usr/local/bin/rake) Gem::Exception: can't find executable rake for gem rake. rake is not currently included in the bundle, perhaps you meant to add it to your Gemfile? /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/rubygems_integration.rb:460:in `block in replace_bin_path' /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/rubygems_integration.rb:480:in `block in replace_bin_path' /usr/local/bin/rake:23:in `<top (required)>'`

matt.fellows
2021-01-28 05:38
Hmmm

matt.fellows
2021-01-28 05:40
Try a `gem install rake` and then try again. Just on mobile so don't have a container to test handy.

matt.fellows
2021-01-28 05:41
But it should exist, I think, perhaps the pwd is incorrect ?

bheemreddy181
2021-01-28 06:49
Not sure what?s going wrong we couldn?t figure it out gem install rake didn?t work too

matt.fellows
2021-01-28 06:59
I just ran that on a fresh image and rake executed OK. What version are you in? Can you please show the docker and other commands?

sagupta
2021-01-28 09:16
It was an authentication issue . I was passing a blank `PACT_BROKER_TOKEN` . However the error message was being truncated . Adding a `--verbose` flag to the publish script helped resolve the issue

sagupta
2021-01-28 09:19
@matt.fellows :taco: :taco: Thanks for helping me in this :thumbsup:

yann.courtel
2021-01-28 10:34
Thanks Maciej for the info!

matt.fellows
2021-01-28 11:08
Nice!

matt.fellows
2021-01-28 11:08
Does it truncate locally without that env var? If it does, that's a bug

athurner
2021-01-28 13:55
has joined #pact-broker

bheemreddy181
2021-01-28 14:14
We are on the latest 2.76.0

alex.mcnair
2021-01-28 18:35
has joined #pact-broker

bethskurrie
2021-01-28 23:30
@bheemreddy181 grab 2.76.1.2 and follow the updated instructions https://github.com/pact-foundation/pact-broker-docker#database-migrations

mailinglistsspammedme
2021-01-28 23:30
has joined #pact-broker

bethskurrie
2021-01-29 05:36
@bheemreddy181 I'm not sure what version you were upgrading from, but if the issue is what I think it is, this version will fix it.

bethskurrie
2021-01-29 05:37
If it doesn't, I'm going to need you to reproduce it using https://github.com/pact-foundation/pact_broker/blob/master/ISSUES.md

sagupta
2021-01-29 11:27
actually i tried it locally also thinking the same , but it doesnt . So that something specific to our CI i guess

sagupta
2021-01-29 11:30
Hello Team, I am currently debugging an error during provider verification . I am using pact-cli and calling the command `verify` . Currently i only get the response from the provider and the differences that it has. Is there a way to get the request from `PACT` that has been sent to the provider API. I have tried checking logs and enabling `--verbose` flag but that didnt help

sagupta
2021-01-29 11:55
Since i am also running pact-cli on docker, so i tried to `sh` in the pact-container to debug and I can successfully execute a `curl` request to the provider which is configured. But when i execute the command where it pulls the contract and send the request, then it fails.

bheemreddy181
2021-01-29 13:42
We are moving from 2.54 to 2.76

steven.beaver.retail
2021-01-29 15:34
has joined #pact-broker

bheemreddy181
2021-01-30 00:18
I am not really sure whether we were on 2.54 then though last time we deployed pact broker was last year may 22 and i could relate that version to 2.54.0

ekberli.elbrus
2021-01-30 16:33
has joined #pact-broker

bheemreddy181
2021-01-31 15:30
finally i found that this is a not pact broker issue but the way how we configured our webhooks. Details updated on the ticket.

bheemreddy181
2021-01-31 22:05
I always had this doubt around pact broker why does pact broker home page shows status of a latest verified pull request ( doesn?t it need to always show the master branch verified version ) and show pull request level details in the matrix ?

bethskurrie
2021-02-01 02:49
It doesn't know the difference between your main branches and your feature branches @bheemreddy181

bheemreddy181
2021-02-01 02:50
isn't the idea to have consumer always verified on master provider ?

bethskurrie
2021-02-01 02:50
yes

bheemreddy181
2021-02-01 02:50
then i felt pact broker home should always show the status of master verification , i might be wrong

bethskurrie
2021-02-01 02:51
It's on my long term todo list to allow the the main development branches to be specified.

bethskurrie
2021-02-01 02:51
not everyone calls the main branch "master"

bethskurrie
2021-02-01 02:51
the broker has no concept yet of differentiating between tags.

bheemreddy181
2021-02-01 02:52
ya i agree - we are now moving away from that naming convention typically `master` to `main`

bheemreddy181
2021-02-01 02:52
makes sense

bheemreddy181
2021-02-01 02:52
pact broker home page generally confuses the new users with this combinational tags

bethskurrie
2021-02-01 02:54
Yeah, I agree, it is confusing

guppy0356.nakira
2021-02-01 08:08
How to configure `Pact.configuration.config_ru_path` ?

guppy0356.nakira
2021-02-01 08:25
I found `Pact.configuration.config_ru_path=` , but I wrote this method in spec/service_consumers/pact_helper.rb. Is it correct?

kjayachandra2000
2021-02-01 14:29
Hi All, can someone help me to create a webhook , I have a consumer and provider service. This job runs on Jenkins any example on configuring webhook would be much appreciated

brendan.donegan
2021-02-01 15:12
@kjayachandra2000 a good first step is to set up a Postman request that triggers the job successfully, which can then be used to feed into the command that creates the webhook

kjayachandra2000
2021-02-01 15:13
can you provide me a sample for postman?

yann.courtel
2021-02-01 16:46
Hi everyone, is there a healthcheck page for the pact-broker that can tell us quickly the state of the app? I insist on the quick part :slightly_smiling_face: the /pacts/latest is way too long. Thanks a lot.

kflo
2021-02-01 17:13
agreed, would be nice to have separate views for ?stable? vs ?development? or whatever you want to call it

nouri.tawfik
2021-02-01 19:37
Hi, /healthcheck Should work for you

george.south
2021-02-01 21:12
has joined #pact-broker

matt.fellows
2021-02-01 21:48
The pact broker CLI tool has a command to create a webhook also

bethskurrie
2021-02-01 21:58
@guppy0356.nakira that's a pact-ruby setting, nothing to do with the Pact Broker


bethskurrie
2021-02-01 22:01
@brendan.donegan please don't ask other people to do your work for you!


kjayachandra2000
2021-02-02 07:58
thanks :thumbsup:

yann.courtel
2021-02-02 09:16
Thanks a lot @bethskurrie. the heartbeat url works. @nouri.tawfik thanks. I don't have this url unfortunately. Maybe it's the version of my broker.

twierzchowski
2021-02-03 07:05
has joined #pact-broker

yassin.hajaj
2021-02-03 10:35
has joined #pact-broker

dany.marques90
2021-02-03 12:48
has joined #pact-broker

marcelo
2021-02-03 13:11
has joined #pact-broker

sandeeparthur
2021-02-03 19:46
has joined #pact-broker

bethskurrie
2021-02-03 21:43
That "/healthcheck" endpoint doesn't exist in the Broker code - maybe it's added by something else @nouri.tawfik @yann.courtel

bethskurrie
2021-02-03 21:44
I'm trying out this Github Discussions thing with a conversation about supporting explicit branches in the Pact Broker https://github.com/pact-foundation/pact_broker/discussions/382 Feedback welcome!

young
2021-02-04 06:40
Hi team, When I tried to create a webhook for a consumer, the 500 Internal Server Error displayed, and I don't know how to see this error log and what happened when I creating webhooks, the attachment [video] is How I operated. Thanks a lot.

kjayachandra2000
2021-02-04 06:54
following to know how to handle this

matt.fellows
2021-02-04 08:38
Can you please share the payload you pasted in there?

matt.fellows
2021-02-04 08:38
Also, you?re going to need to get your hands on the pact broker log file - it should have the details of that error

young
2021-02-04 09:15
@matt.fellows thanks `{` "events": [ { "name": "provider_verification_published" } ], "request": { "method": "POST", "url": "https://circleci.com/api/v1.1/project/bitbucket/neuroncn/nsoperator/build?circle-token=6d5fb0fb6ee11ea29b2b8e27e1e34328ebed69c1150e", "headers": { "Content-Type": "application/json" }, "body": { "branch": "dev" } } }

nouri.tawfik
2021-02-04 12:08
Hi, Sorry it's a custom version of pact-broker You are right, the official endpoint is '/diagnostic/status/heartbeat' Have a nice day

matt.fellows
2021-02-04 12:12
hmmm, just tried - works for me

matt.fellows
2021-02-04 12:15
You?re going to need to get the log files

octoberclub
2021-02-04 16:27
has joined #pact-broker

slavick
2021-02-04 17:21
has joined #pact-broker

imran.settuba
2021-02-04 18:57
has joined #pact-broker

bethskurrie
2021-02-04 21:57
@young that's not the right URL for creating a webhook.

bethskurrie
2021-02-04 21:58
Why not use the pact-broker CLI?



abubics
2021-02-04 23:31
as an aside, there's probably a bug somewhere if a 500 is coming back . . . but that's not the solution to this problem :innocent:

bethskurrie
2021-02-04 23:35
It might be this bug

bethskurrie
2021-02-04 23:35
```commit 1e6a06a0baba53c7e80a7eb2f7d1bf1913ef2491 Author: Beth Skurrie <beth@bethesque.com> Date: Fri Oct 16 08:21:43 2020 +1100 fix: typo when rendering created webhook for old webhooks path Fixes: https://github.com/pact-foundation/pact_broker/issues/356 diff --git a/lib/pact_broker/api/resources/pact_webhooks.rb b/lib/pact_broker/api/resources/pact_webhooks.rb index 1e0acd80..5220cbc3 100644 --- a/lib/pact_broker/api/resources/pact_webhooks.rb +++ b/lib/pact_broker/api/resources/pact_webhooks.rb @@ -52,7 +52,7 @@ module PactBroker def from_json saved_webhook = webhook_service.create next_uuid, webhook, consumer, provider - response.body = Decorators::WebhookDecorator.new(saved_webhook).to_json(decoractor_options) + response.body = Decorators::WebhookDecorator.new(saved_webhook).to_json(decorator_options) end```

matt.fellows
2021-02-04 23:40
ha

matt.fellows
2021-02-04 23:40
It?s probably that muscle memory from ?pa*c*ticipant?

christopher.roberts
2021-02-05 01:02
has joined #pact-broker

abubics
2021-02-05 01:28
refuctored :wink:

matt.fellows
2021-02-05 01:30
:laughing:

young
2021-02-05 01:40
Thank you all:pray:

r.darcel
2021-02-05 09:15
has joined #pact-broker

yann.courtel
2021-02-05 09:20
Hi everyone, I'm trying to upgrade a pact-broker we have a on VM but I keep having this message. I read it could be the Ruby on rail is installed on the VM... Anyway, I'm first trying to see the exact error. I have the error ID but no way to get that in the docker logs. Any idea where to search first? Thanks a lot.

yann.courtel
2021-02-05 10:21
Found out the error log were into my /var/log/nginx/error.log It was a database connection error. After correcting my credentials, it connected but had an insufficient privileges error..... even though I granted all privileges to the new user I created and put it owner to the database containing my pacts... very frustrating.

yann.courtel
2021-02-05 10:43
App 344 output: 2021-02-05 10:42:14.302106 E [344:3460 log_quietener.rb:18] pact-broker -- PG::InsufficientPrivilege: ERROR: permission denied for relation schema_migrations: SELECT * FROM "schema_migrations" ORDER BY "filename" DESC LIMIT 1 App 344 output: Error: The application encountered the following error: PG::InsufficientPrivilege: ERROR: permission denied for relation schema_migrations

yann.courtel
2021-02-05 13:57
I've got it. I tried to hook a new user to the database to create an updated version of it but the permissions were wrong. It was owner of the database but it also needed to be owner of the 51 tables. Now it's working :slightly_smiling_face:

ashish.joshi
2021-02-06 01:07
has joined #pact-broker

gayatree.eee
2021-02-08 11:43
In webhook we have added a body as follow. {"event_tyep":"pact_changed", "client_payload":{"consumer":"${pactbroker.consumerName}"}}. Please let us know how to fetch these values in provider code

matt.fellows
2021-02-08 11:44
that?s going to be entirely up to how your CI reads the incoming webhook

matt.fellows
2021-02-08 11:45
in this case, `client_payload` is something that GH actions passes through to the build, and the build can then choose to do somethnig with that value (typically you would want to know what pact changed, and verify just that pact)


matt.fellows
2021-02-08 11:51
the configuredhttps://github.com/pactflow/example-provider/blob/c336703f64f4767f54581f61d20d280c50233c7d/Makefile#L83-L93 sets that value when a new pact is published by a consumer for that provider

matt.fellows
2021-02-08 11:52
The actual test checks for the presence of the `PACT_URL` environment variable, and if it?s set, only verifies the incoming pact file and not the standard set: https://github.com/pactflow/example-provider/blob/master/src/product/product.pact.test.js#L26-L28


matt.fellows
2021-02-08 11:53
(I believe you?ve run the workshop, but it may not have made sense at that time yet! :slightly_smiling_face: )

irldev
2021-02-08 14:02
Does anyone know what is the correct path to use to post verification results directly to the broker?

irldev
2021-02-08 14:04
We have tried the post request here but get a 404 https://github.com/pact-foundation/pact_broker/issues/160

irldev
2021-02-08 14:48
False alarm, think we got it sorted

alex.mccormick
2021-02-08 18:33
has joined #pact-broker

przemek.sech296
2021-02-08 23:18
has joined #pact-broker

vplows
2021-02-09 06:00
has joined #pact-broker

stefanos.varsanis
2021-02-09 09:56
Hello. We've noticed a weird behaviour in pact-broker which doesn't make much sense, unless we're missing some critical info: Version 10.24.1 tagged with `Release` was created 22 days ago. On the other hand version 26 was tagged with `Release` 15 days ago. However the 10.24.1 appears as the latest Release tag which defeats the purpose of trying to target the actual latest one. Any ideas on this?

stefanos.varsanis
2021-02-09 09:57
(26)

stefanos.varsanis
2021-02-09 10:37
For reference the pact broker matrix looks like this:

stefanos.varsanis
2021-02-09 10:38
24.1 was created after 25 but before 26

philipchardwick
2021-02-09 15:35
Hey, I'm looking at implementing a http://concourse-ci.org resource which does the equivalent of the contract changed webhook (the difference being that with concourse, it polls resources like the pact broker for changes rather than being told of changes by a webhook). With that in mind is there a way to get the hash of the pact content from the HTTP API? Is this something I should compute myself from getting the pact and it's interactions? My current plan is to get a list of the consumers which have pacts with a provider and then get the latest pact for each one and see if theres a verification already - if there's one already then it's because the hash hasn't changed and concourse doesn't need to do anything. But it would be good to have the hashes of the pact content as part of the "versions" concourse keeps a track off (this is more concoursey since if theres a change in version, concourse triggers the pact verify)

rodney.stromlund
2021-02-09 16:18
has joined #pact-broker

nada
2021-02-09 19:00
has joined #pact-broker

siddhardhan
2021-02-09 20:21
has joined #pact-broker

ryanlevell
2021-02-09 21:04
has joined #pact-broker

ryanlevell
2021-02-09 21:06
Hello. I am running the pact broker Ruby gem. When I click on the ?Example App? matrix icon, I get a 500 error. ?logger.rb:527:in info? with error ?ArgumentError unknown keywords: :selectors, :options? Any ideas how to resolve?

ryanlevell
2021-02-09 21:48
I reverted from 2.76.2 to 2.65.0 (the version before that log line was added to matrix/service.rb #16) and it is working.

bethskurrie
2021-02-09 22:06
Are you running it on Ruby 3.0 @ryanlevell?

bethskurrie
2021-02-09 22:06
Can I ask why you need to use the gem and not the docker image?

bethskurrie
2021-02-09 22:07
@philipchardwick can you tell me more about your situation and why you're solving this particular problem this way?

ryanlevell
2021-02-09 22:07
Ruby 2.5. We are using a PaaS that expects a ruby or java application (as far as I can tell)

bethskurrie
2021-02-09 22:08
hm.

bethskurrie
2021-02-09 22:09
I can't replicate it.

bethskurrie
2021-02-09 22:10
Are you sure it was 2.76.2?

bethskurrie
2021-02-09 22:11
I'd really recommend using the docker image if possible. You'll need to research how the Docker image is configured so that you can replicate the recommended configuration.

ryanlevell
2021-02-09 22:12
I used the docker image previously on a ?dev? machine, but that machine ?auto expires? every X weeks due to company security policies, and was told to move it to the PaaS for a permanent solution.

bethskurrie
2021-02-09 22:12
There are certain settings in the default ruby configuration that are no longer recommended as best practice.

ryanlevell
2021-02-09 22:12
My only option seems to be ruby right now

bethskurrie
2021-02-09 22:12
Ok, make sure you have the right config then.


bethskurrie
2021-02-09 22:13
Follow the code back to the defaults.

bethskurrie
2021-02-09 22:14
`base_equality_only_on_content_that_affects_verification_results` should be true

bethskurrie
2021-02-09 22:14
`order_versions_by_date` should be true

bethskurrie
2021-02-09 22:14
`base_url` should be set

bethskurrie
2021-02-09 22:14
`webhook_http_method_whitelist` should be ["POST"]

bethskurrie
2021-02-09 22:15
`webhook_scheme_whitelist` should be `["https"]`

bethskurrie
2021-02-09 22:15
And you'll need to roll your own authentication.

ryanlevell
2021-02-09 22:15
Ok I?ll update the config. Thanks for the info!

bethskurrie
2021-02-09 22:16
`With that in mind is there a way to get the hash of the pact content from the HTTP API?` Yes

bethskurrie
2021-02-09 22:17
If you get the latest pact, then look at the `pb:pact-version` relation, that URL tells you the hash of the content. If that changes, the content has changed.

bethskurrie
2021-02-09 22:18
Keep in mind the tags/branches

bethskurrie
2021-02-09 22:18
I don't want you fixed on that old version though.

bethskurrie
2021-02-09 22:18
There are a lot of optimisations and improvements about to come out.

bethskurrie
2021-02-09 22:18
If you can give me a repro codebase, that would help.


ryanlevell
2021-02-09 22:22
Sure I?ll try to get a repro

bethskurrie
2021-02-10 04:42
@stefanos.varsanis the ordering is always based on the order of the version, not the order the tags were applied


bethskurrie
2021-02-10 04:43
Coming out soon I'll be adding explicit support for deployments/releases which will make the "latest" behave as you would expect.

lars.hisken916
2021-02-10 08:08
has joined #pact-broker

philipchardwick
2021-02-10 08:17
Concourse tries to be deterministic, so it doesn't really support starting things from webhooks (e.g. what if the ci was down when the webhook was sent) they encourage devs to get inputs to their pipelines by polling the source of truth (pact broker) to see if anything has changed. Ah thank you so much for pointing that out - it literally says it in the title "Pact content version permalink" :man-facepalming: that's perfect for this

pauligoe10
2021-02-10 08:19
has joined #pact-broker

tusharvarm
2021-02-10 09:38
has joined #pact-broker

bethskurrie
2021-02-10 10:11
I'm not sure how you'd poll to pick up every new tagged pact :thinking_face:

bethskurrie
2021-02-10 10:11
You can poll the latest, but there might be multiple publications between polls.

bethskurrie
2021-02-10 10:11
From different branches.

stefanos.varsanis
2021-02-10 10:11
Thanks @bethskurrie. In this case shouldn't the 10.26.0 be the latest since it was created after 10.24.1?

bethskurrie
2021-02-10 10:12
It would be easy to miss one.

philipchardwick
2021-02-10 10:12
If there had been multiple publications, I think the provider test would pick up all the new ones that had been published in between if I'm using wip pacts

philipchardwick
2021-02-10 10:12
unless I'm misunderstanding wip pacts?

bethskurrie
2021-02-10 10:13
Ah, true.

bethskurrie
2021-02-10 10:13
That should help

bethskurrie
2021-02-10 10:14
It could toggle between content a and content b and back to a, making it seem like a change hadn't occurred.

bethskurrie
2021-02-10 10:14
It would get picked up eventually

bethskurrie
2021-02-10 10:14
But it might not be reliable.

philipchardwick
2021-02-10 10:14
Yeah good point

bethskurrie
2021-02-10 10:16
Trying to think of what you could poll to get the info you need.

bethskurrie
2021-02-10 10:17
There is a versions resource, that can be paginated

bethskurrie
2021-02-10 10:17
That would be the best

philipchardwick
2021-02-10 10:18
ah cool - that would work well

bethskurrie
2021-02-10 10:18
Assuming you're storing some state in the thing that polls


philipchardwick
2021-02-10 10:20
I think concourse expects to receive the full list and it does the diff for you so I think I can just return the full list, depending on how long it is

bethskurrie
2021-02-10 10:20
Well, it could be thousands!

bethskurrie
2021-02-10 10:21
You'd want to turn on the auto clean up. Which now I think of it, I have yet to document properly.

philipchardwick
2021-02-10 10:22
Ah yes - been thinking we need to start using the auto clean up

igorsharf
2021-02-10 10:39
has joined #pact-broker

stefanos.varsanis
2021-02-10 10:42
Could it be that the broker is considering the 10.24.1 (minor version) greater than the 10.26.0 ?

bethskurrie
2021-02-10 10:44
Actually, if you can only poll a fixed resource, the versions endpoint won't help. You'd need to check each of the versions to see if the sha had changed.

bethskurrie
2021-02-10 10:44
It's a pacticipant versions resource, not pact versions.

bethskurrie
2021-02-10 10:45
I'll have a think about it, but I'm not sure what I can recommend.

kieran
2021-02-10 17:13
has joined #pact-broker

poward
2021-02-10 18:17
has joined #pact-broker

ckhadilkar
2021-02-10 21:16
has joined #pact-broker

carolyn.biggar
2021-02-11 01:12
When using `arrayEachLike` in the java Pact DSL (in a kotlin test) , the pact broker UI for the pact shows an empty array rather than an example. This tiny example of a single property object ```arrayEachLike() .stringType("name", "My Biscuit Name")``` in https://github.com/csbiggar/shop/blob/master/src/test/kotlin/contracts/BiscuitsContractTest.kt#L95 shows up on the broker as, ```biscuits will respond with: { "status": 200, "headers": { "Content-Type": "application/json" }, "body": [ ] }``` ? empty body If I view the pact in the Api Browser on the broker it _does_ show content in the array ```"response": { "status": 200, "headers": { "Content-Type": "application/json" }, "body": [ { "name": "My Biscuit Name" } ], "matchingRules": { .. etc``` Could you tell me if this is intentional behaviour of the pact broker UI, or a defect? Not a huge thing but has been causing some confusion for our consumers Here's an example https://github.com/csbiggar/shop - you'll need to run a broker locally or change the publishing target to an existing one to see the UI defect. The test in question is `should find all biscuits` in https://github.com/csbiggar/shop/blob/master/src/test/kotlin/contracts/BiscuitsContractTest.kt#L95 NB If I change `arrayEachLike()` to `arrayMinLike(1)` , it shows up correctly (or at least, as I expect it to) on the pact broker like this ```biscuits will respond with: { "status": 200, "headers": { "Content-Type": "application/json" }, "body": [ { "name": "My Biscuit Name" } ] }``` Many thanks for any thoughts!

carolyn.biggar
2021-02-11 01:14
This is what the pact shows as on the broker UI

carolyn.biggar
2021-02-11 01:15
And this is what I'd expect it to show as (same as if I used `arrayMinLike(1)` )

carolyn.biggar
2021-02-11 01:34
This is observed in pact broker version `2.72.0` and `2.69.0`

bethskurrie
2021-02-11 01:43
@carolyn.biggar I think it's because the library parsing the pact doesn't understand those matching rules.

bethskurrie
2021-02-11 01:43
I need to separate the pact broker code from the actual pact library. Can you raise the issue with as much detail as you can in the pact_broker repo please?

carolyn.biggar
2021-02-11 02:09
Ok sure , I?ll do that tomorrow (UK time!) and add a link to the issue here when I?ve raised it. Thanks for looking !

yann.courtel
2021-02-11 08:35
Hi everyone, is there a way in the newest version to configure the page size of the broker's home page? Right now it's 100 but I'd like it to be 1000 by default. Thanks a lot.

bethskurrie
2021-02-11 08:40
Not permanently, but if you do add `&pageSize=1000` to the top it will do what you want @yann.courtel

sagupta
2021-02-11 09:57
Hey team , we are using OSS broker in our org. We are tagging consumer with every build with $CI_BRANCH and $CI_COMMIT_SHA and same for provider as well. THus creates a lot of entries in Pact broker so was thinking what should be the best practice to remove some of the old entries so we can see easily which ones are the latest versions .

bethskurrie
2021-02-11 09:57
Why are you tagging with the sha?

bethskurrie
2021-02-11 09:57
The sha should be the version number.

bethskurrie
2021-02-11 09:59
I've recently created (but not officially documented) an automatic clean up process, but I'd like to understand why you're doing something that seems so unusual.

yann.courtel
2021-02-11 10:19
I then fail to see why there is pagination at all... If we don't have a way to search for a specific pact in our 800+ pacts without having to change the url, it will be hard to find it. The only way was to do a ctrl + f but now with the pagination, it's no longer possible. Would it be a nice feature request? I meant the default page size. And on another iteration, a search capabilities would be awesome too. Thanks @bethskurrie

sagupta
2021-02-11 11:24
oh sorry my bad , we are using $COMMIT_SHA for version indeed and $CI_BRANCH for tagging . Also we tag again once we deploy to staging with `Staging` . The main motivation for cleaning up is to not have too much data in Broker once we add more consumer provider pairs . So wanted to know if there is an option to automatically clean up old entries

sagupta
2021-02-11 15:33
I also have a question about this `Allow contracts to change without breaking your builds` , If we want to have green builds in provider that it is not impacted by a contract change, then does it mean that we no longer need 2 separate jobs on provider side (one when provider change, one when contract changes). we can just have one job which verifies against a stable version of consumer and we can trigger same job via webhook when a contract change too . Is my understanding correct?



carolyn.biggar
2021-02-11 18:47
Issue raised here, let me know if this is enough information: https://github.com/pact-foundation/pact_broker/issues/387

neild
2021-02-11 18:53
has joined #pact-broker

ryanlevell
2021-02-11 19:31
Beth, I found the root cause for my error. I was using this http://config.ru as a basis: https://github.com/alphagov/govuk-pact-broker/blob/f52f2bd0a0e3d66c0b3adb57279361af8b9ae27b/config.ru#L57 This logger was not a semantic_logger hence why the http://logger.info call was failing. I updated with your recommendations and it is working :)


bethskurrie
2021-02-11 21:32
I still need to officially document it, as there are complications if there are multiple instances running against the same database. Just double check the names of the env vars against the code, because some of them have changed.

sagupta
2021-02-11 21:58
yea got it . I have also gone through the conversation in the issue you listed and its helpful. Thanks for this Beth :thumbsup:

ryanlevell
2021-02-11 22:02
Hello. What is the best way to whitelist all read-only requests (no auth required)? My provider side test is failing because the ?/for-verification? endpoint is a POST and I am whitelisting only GET in the http://config.ru. I could whitelist specific urls as well, but wondering if there is a better way.

painenigowthami
2021-02-11 22:32
has joined #pact-broker

ryanlevell
2021-02-11 22:38
Here is the api call that is POST https://github.com/pact-foundation/pact_broker/blob/master/lib/pact_broker/doc/views/provider-pacts-for-verification.markdown I can maintain a whitelist. My currently logic allows all GETs and the endpoint ?/for-verification?. Are there any other non-GET read-only endpoints I should add to my whitelist?

stephenkilbourn
2021-02-11 23:02
has joined #pact-broker

tcarlson
2021-02-11 23:05
has joined #pact-broker

bethskurrie
2021-02-12 03:18
@ryanlevell that's the only one.

bethskurrie
2021-02-12 03:19
Are you not using the built in auth with the docker image?


abubics
2021-02-12 03:25
If you want your provider not to be impacted by contract changes, what will your trigger be for updating the provider? After a short time, the consumer won't be able to deploy, and there'll be a big backlog of changes to implement, that you don't get notified about.

abubics
2021-02-12 03:25
There are a couple of new features that provide a bit more flexibility (WIP pacts, and pending pacts) . . . you might want to read up about them, too.

bethskurrie
2021-02-12 03:29
@sagupta as Boris says, you still need your webhook -> verification build.

ryanlevell
2021-02-12 03:31
Great! Thank you for the rules. No I?m the guy from yesterday using the ruby gem. (I commented above my root cause for yesterday?s issue.. was my fault due to old http://config.ru)

bethskurrie
2021-02-12 03:31
> we can trigger same job via webhook when a contract change too You really want to verify just the pact that has changed using the URL that is passed through the build. You'll get quicker feedback this way. There's some metadata that gets passed in the URl that means that when you get complex CI/CD pipelines that use webhooks to report the statuses of the commits back to github, the right results get sent to the right SHA.

r.strauch
2021-02-12 10:15
has joined #pact-broker

ztlboy05
2021-02-12 14:57
has joined #pact-broker

smith260194
2021-02-12 15:22
has joined #pact-broker

ryanlevell
2021-02-12 16:37
Hello. Sorry, I believe this is my last blocker. I am using the pb cli docker image. Our new server has a dev certificate which is causing the cli to throw ?SSLError: certificate verify failed (unable to get local issuer certificate) matrix.rb:15:in? Is there a way to disable the ssl check for the docker image?

ryanlevell
2021-02-12 17:14
I am also trying ?-e SSL_CERT_FILE=...? but getting same error as above

ryanlevell
2021-02-12 19:04
Ok I found the documentation in docker hub for ssl. It is similar to what I?m doing, I?ll keep digging.

sagupta
2021-02-12 20:16
I have read about "Pending pacts" and i think this is what i need in this case :point_up:

dabfleming
2021-02-12 20:34
has joined #pact-broker

ryanlevell
2021-02-12 21:26
I downloaded the cert from Firefox and passing the options to docker but still getting the same error message as originally

ryanlevell
2021-02-12 21:44
I copied the pem from one of our internal batch servers and it is working. Idk why the pact broker pem downloaded from Firefox doesn?t work :man-shrugging:

prasanthp
2021-02-13 00:45
has joined #pact-broker

bethskurrie
2021-02-13 01:05
@ryanlevell Put them both into something like https://www.sslshopper.com/certificate-decoder.html and see what the difference is.

bethskurrie
2021-02-13 01:06
Maybe we need to update our instructions.

ryanlevell
2021-02-13 01:07
Thanks Beth, I?ll try that.

bethskurrie
2021-02-13 05:53
@ryanlevell if you're using the raw rubygem, I would grab all the code from the pact-broker-docker repo to use with it.


bhardwajdiwakar
2021-02-14 22:38
has joined #pact-broker

hiteshpatadia
2021-02-15 06:29
has joined #pact-broker

vikrant.sarkaniya
2021-02-15 13:31
has joined #pact-broker

lemitrou
2021-02-15 14:20
has joined #pact-broker


helloraj
2021-02-16 08:09
has joined #pact-broker

jamesmlucas
2021-02-16 19:29
has joined #pact-broker

gabe707
2021-02-16 20:31
has joined #pact-broker

gabe707
2021-02-16 20:32
question how do we get pass this error

gabe707
2021-02-16 20:32
pact due to error: PactBroker::Client::Error - Authentication failed

gabe707
2021-02-16 20:33
```PactBroker::Client::PublicationTask.new(:local) do | task | task.consumer_version = "1.0.0" task.pact_broker_base_url = LOCAL_PACT_BROKER_BASE_URL task.pattern = "/consumer/spec/pacts/*.json" end```

gabe707
2021-02-16 20:33
even if i put in the pactflow token i still get the same error

wangpei9679
2021-02-16 21:29
has joined #pact-broker

tjones
2021-02-16 22:52
How are you setting the token? Do you have other PACT_* environment variables set?

wangpei9679
2021-02-16 22:57
Hi guys, anyone has idea on this?

matt.fellows
2021-02-16 23:01
(repeating here for posterity) Is the contract the same though? Because if it is, the verification result will apply to _all_ of the contracts with the same content i.e. if you make 4 separate publishes and give them different tags, but the content is the same. The verification result for *any* of the versions will apply to *all* of the versions

geir
2021-02-16 23:03
has joined #pact-broker

wangpei9679
2021-02-16 23:19
yes. the contract content are totally same

matt.fellows
2021-02-16 23:23
so that answers it. Is it a problem?

wangpei9679
2021-02-16 23:24
if that. all looks good. Thanks.

bethskurrie
2021-02-17 00:30
It looks like you're using a local, self hosted broker. There are no tokens for that one.

bethskurrie
2021-02-17 00:31
If you're using the docker image, it supports basic auth.


soruma.net
2021-02-17 05:58
has joined #pact-broker

therimpact
2021-02-17 12:30
has joined #pact-broker

gabe707
2021-02-17 14:42
@bethskurrie

gabe707
2021-02-17 14:43
```require 'pact_broker/client/tasks' PactBroker::Client::PublicationTask.new do | task | task.consumer_version =1.0 task.pattern = 'ascent-rails/spec/pacts/*.json' # optional, default value is 'spec/pacts/*.json' task.pact_broker_base_url = 'https://ascent.pactflow.io' task.tag_with_git_branch = true|false # Optional but STRONGLY task.tags = ["dev"] # optional task.pact_broker_token = 'pDWJsxMuthyK693Dhh7kja' # Bearer token end```

gabe707
2021-02-17 14:43
if I use the pact broker token in here it gives an error of not recognizing that

gabe707
2021-02-17 14:44
if i take it out it still gives an authentication error

gabe707
2021-02-17 14:44
we're using pactflow

gabe707
2021-02-17 14:45
Tagging version 1.0 of Ascent Rails as "dev" Failed to tag version 1.0 of Ascent Rails due to error: PactBroker::Client::Error - Authentication failed}

gabe707
2021-02-17 14:50
---------------------

gabe707
2021-02-17 14:51
*? service_providers* *git:(gabe-tests) ?* rake pact:publish rake aborted! NoMethodError: undefined method `pact_broker_token=' for #<PactBroker::Client::PublicationTask:0x00007ff836a143f8> Did you mean? pact_broker_base_url=

gabe707
2021-02-17 15:26
we're using pactflow

gabe707
2021-02-17 15:26
i took the token from pactflow

gabe707
2021-02-17 15:26
and it still has an authentication error

arindam.datta
2021-02-17 15:57
Hi @bethskurrie and @matt.fellows: I have a scenario where I am stuck and I don't know how to come out of this. The situation is like this: 1. Provider v1 and Consumer v1 are deployed on `prod` env. 2. Provider team decided to change an existing propertyName from `TwoFactor` to `TFA`. 3. Provider team tries to deploy v2, but fails. This is expected as this breaks contract with Consumer v1 which is already deployed on `prod`. 4. Now Consumer team also renames the property to `TFA` 5. Consumer team tries to deploy v2. 6. New Consumer pact is published to Broker with version `v2` and gets tagged with `master` 7. Consumer v2 is failed to be deployed (fails at Can-I-Deploy) since the provider v2 is not deployed to `prod` (provider v2 failed at step 3 above) --------------------------------------------------- Now the situation seems like a deadlock. Situation on broker now is like below:

arindam.datta
2021-02-17 15:58
Moreover, When my providers `main` pipeline triggers, I get the following message during verification test even though `Pending Pact` is enabled, also `wipSince` is included: `This pact has previously been successfully verified by ProviderSvc. If this verification fails, it will fail the build. Read more at https://pact.io/pending`

arindam.datta
2021-02-17 16:01
Thanks in advance :pray:

bethskurrie
2021-02-17 21:32
@gabe707 firstly, please rotate your token because you've just put it up for the world to see!

bethskurrie
2021-02-17 21:33
Secondly, what version of the pact_broker-client gem are you using? It looks like you have an old version there.

bethskurrie
2021-02-17 21:40
@arindam.datta the only way to get both the consumer and provider out keeping everything green is to duplicate the field.

bethskurrie
2021-02-17 21:40
1. Provider adds TFA field (keeping TwoFactor as well) and deploys to prod

bethskurrie
2021-02-17 21:40
2. Consumer updates expectation, deploys to prod.

bethskurrie
2021-02-17 21:41
3. Provider removes old TwoFactor field, deploys to prod.

andrzej.igielski
2021-02-17 21:41
has joined #pact-broker

matt.fellows
2021-02-17 22:16
this is called the expand and contract approach, and is really the only real approach aside from brute forcing into production and ?deploying together?

mikewagner21
2021-02-18 03:15
has joined #pact-broker

arindam.datta
2021-02-18 05:09
Thanks @bethskurrie and @matt.fellows, I'll practically apply the steps as mentioned by Beth, hope it'll solidify my understanding. @hiteshpatadia, this :point_up: is the situation we got ourselves into yesterday.

arindam.datta
2021-02-18 05:11
@bethskurrie, another closely related question: if instead of renaming, Provider had removed an existing property, then also we would be into similar situation?

arindam.datta
2021-02-18 05:12
@matt.fellows question for you too :point_up:

matt.fellows
2021-02-18 05:14
if you remove a field that a consumer uses, the provider will be blocked until all consumers stop using it

matt.fellows
2021-02-18 05:14
Otherwise, it would lead to you deploying something that will break the consumer in production

arindam.datta
2021-02-18 05:36
Thanks a lot @matt.fellows and @bethskurrie, you guys are such helpful!

arindam.datta
2021-02-18 05:36
Oh yes, this is different situation. Right

arindam.datta
2021-02-18 05:49
Thanks for participating in this discussion @bethskurrie and @matt.fellows. Talking to you always elevates my confidence in the world of contract testing. You guys are such helpful and passionate. :pray:

matt.fellows
2021-02-18 05:50
Thank you for the lovely feedback, this genuinely makes our day(s)!

khandelwalbhushan
2021-02-18 08:10
has joined #pact-broker

arindam.datta
2021-02-18 08:15
@khandelwalbhushan, bringing your notice into this thread. This is the situation we got ourselves into.

aniket.agarwal
2021-02-18 09:21
has joined #pact-broker

arpit.modani
2021-02-18 09:43
has joined #pact-broker

brendan.donegan
2021-02-18 10:42
So, we have a recurring problem with people inventing provider names because they don?t understand how Pact works. I was wondering if there?s any feature available to that contracts can?t be published unless the provider name already exists?

bethskurrie
2021-02-18 10:43
There's a feature that detects "similar" names and raises an error if people try to publish "foo-service" and "Foo Service".

bethskurrie
2021-02-18 10:43
There is not that thing that you want. However, I was planning on adding a "merge" feature for when people do exactly what you're talking about.


brendan.donegan
2021-02-18 10:47
it didn?t seem to work in this case

brendan.donegan
2021-02-18 10:47
existing was something like `APW BOX API`, new one was `APW REG API`

bethskurrie
2021-02-18 10:47
It's very hard to write code that doesn't get false positives.

bethskurrie
2021-02-18 10:48
Yeah, that wouldn't get picked up.

brendan.donegan
2021-02-18 10:48
i can understand it?s fraught

bethskurrie
2021-02-18 10:48
Put a vote on that merge one, or feel free to raise another feature request in canny

brendan.donegan
2021-02-18 10:48
better education seems to be the solution for now!

bethskurrie
2021-02-18 10:48
TBH, people need lots of structured education about how to use pact anyway.

brendan.donegan
2021-02-18 10:49
most common misunderstanding is people thinking provider === endpoint

bethskurrie
2021-02-18 10:49
It's not something that people can pick up by osmosis.

brendan.donegan
2021-02-18 10:49
my teams have had 18 months at this point :smile:

brendan.donegan
2021-02-18 10:50
definitely one of the biggest challenges is getting large groups of people to ?get? it

bethskurrie
2021-02-18 10:50
the orgs that have the best success with pact do a lot of internal training

bethskurrie
2021-02-18 10:51
it does have a steep learning curve

byronth
2021-02-18 11:45
has joined #pact-broker

isa.levine
2021-02-18 23:37
has joined #pact-broker

abubics
2021-02-19 00:15
fwiw, conflating concepts like endpoint & provider seems like a deeper issue to me . . . some internal DDD (domain-driven design) training might have a lot of collateral benefits :slightly_smiling_face:

bethskurrie
2021-02-19 00:16
I've seen the terms mixed up in organisations that follow a very old school technology approach, esp windows related. So I think there are tools/conceptual frameworks that do use the term "provider" to mean a single endpoint.

abubics
2021-02-19 00:17
Definitely, in .net, that is an overloaded term. Lots of `[*Provider]` annotations from my memory :upside_down_face:

abubics
2021-02-19 00:19
That is a distinction that's important across different levels of abstraction. Provider here is a system-level component, not a code-level component :thinking_face:

abubics
2021-02-19 00:19
I always wonder if that's the issue at a particular place, or how many other guesses could be correct :sweat_smile:

bethskurrie
2021-02-19 00:19
it is a very generic and overloaded term. There are docs that explain it, which leads me to think they haven't been read.

r.strauch
2021-02-19 08:41
@r.strauch has left the channel

brendan.donegan
2021-02-19 09:41
I think different orgs use different terms to describe what a ?provider? actually is, and almost no-one uses ?provider?

brendan.donegan
2021-02-19 09:42
We would use ?service? for example

brendan.donegan
2021-02-19 09:43
I wrote this in our internal docs: ```A provider in Pact refers to an individual service which provides data to a consumer, primarily in our case, through a REST API. Being independent refers to the fact that it can be deployed separately from any other service. Individual endpoints provided by the same service are not separate providers. Examples of providers are e.g. IDS GRID API, Assignments API, Wormhole, etc. Conversely, Student Assignments API and Teacher Assignments API would not be separate providers because these endpoints both belong to the Assignments service and cannot be deployed separately. Provider names are an important part of the contract as they are used in the provider verification step to get contracts which apply to the particular provider being verified. For this reason it is important not to use arbitrary values for the provider name. Many providers are already defined on the Pact broker so prior to adding new Pact tests you should check if the provider already exists and use the same name. If the provider you need does not exist, then you should speak to the team that maintains the provider and agree on a name to use, so that they can use it too when they set up the verification.```

brendan.donegan
2021-02-19 09:43
(reading that i, i need to fix some of the grammar :D)

brian.pfretzschner
2021-02-19 10:15
has joined #pact-broker

abubics
2021-02-19 12:46
Sounds like a good description for your context :ok_hand:

abubics
2021-02-19 12:49
Maybe a helpful distinction (which is probably in the docs) is that in the context of an interaction, there's a consumer making a request, and a provider facilitating the request, providing a response. But outside that context, the terminology is irrelevant. For example, a provider can also be a consumer if it talks to other APIs.

arindam.datta
2021-02-19 15:15
Hi @beth (http://pactflow.io/Pact Broker/pact-ruby) and @Matt (http://pactflow.io / pact-js / pact-go), sorry that I come here every now and then with some situation and expect you guys will help me out :slightly_smiling_face: , but being a novice in CDC coming to the experts is my only option. 2 days back you helped me with a situation by suggesting the `expand and contract approach`. Today I am stuck with the following situation. Consider I have the exactly same set-up as javascript ci-cd workshop: 1. Provider v1 is deployed on ``prod`` where the Product has two properties (along with many others) ``seller`` and ``stock`` 2. Consumer v1 is deployed on ``prod`` which uses the above two propertis. 3. Now Provider removes one property ``stock``. 4. Provider team tries to deploy Provider v2, but fails. It's expected, since it breaks the contract. 5. Now Consumer team also removes the property ``stock``. 6. Consumer team tries to deploy Consumer v2, which in turn triggers Provider verification on ``master`` branch. Verification by Provider v2 is successful. But Consumer still fails to deploy since Provider v2 is not on production yet. This again seems like a deadlock situation. The situation on Broker is like below: Cc: @hiteshpatadia @khandelwalbhushan

phil.endsley
2021-02-19 16:15
If you're just removing a property for consumer v2, it should still pass verification with provider v1. So in order to get v2 for both consumer and provider deployed: 1. Deploy consumer v2 (This should work, because consumer v2 is compatible with provider v1) 2. Deploy provider v2 (This should work, because provider v2 is compatible with consumer v2) > Now Provider removes one property ``stock`` If this change was merged into the main branch, I would expect the provider build to start failing, because they introduced a breaking change. This version of the provider cannot be safely deployed independently until it satisfies all the contracts with it. If the provider build is broken because of the failing contract, I think your challenge will be running verification against only consumer v2

arindam.datta
2021-02-19 16:28
Hi @phil.endsley, if you look at my sequence, I removed the property from provider first on master itself (though absolutely against rule). Then, I removed it from consumer, this too on master(against rule again). Now the consumer build triggers provider verification which checks out master branch of provider. So, once the verification is done, the result is published to broker for Provider version v2 which is not yet on prod. As a result the can-i-deploy step of consumer fails because it's pact was NOT verified by provider v1. So, now I am stuck. None of them can go to production now. What should I do to come out of this situation is my question. I know, in real development process I'd never do any changes directly on master.

brendan.donegan
2021-02-19 17:12
i presume the issue here is that when you?re asking the question ?does v2 of my consumer work with v1 of the provider (the version on prod)? the answer from can-i-deploy is going to be no, not because it doesn?t work with v1 (it actually does), but because it was never verified with v1?

bheemreddy181
2021-02-19 18:00
Question around slack notifications https://docs.pact.io/pact_broker/webhooks/template_library/#slack---post-notification , is the idea to have same body for contract content changed and contract verification published

matt.fellows
2021-02-19 23:40
I suppose it's up to you what you want sent to your slack channel

matt.fellows
2021-02-19 23:42
I'd have separate ones personally

arindam.datta
2021-02-20 06:00
Hi @brendan.donegan, yes I know. Now, how can I get out of this situation, in other words, how can I get the 'v2' of both provider and consumer deployed on production? Do I need to make any change in any ci-cd pipeline? Note: Please consider I'm using exactly the same workflow as the javascript ci-cd workshop.

arindam.datta
2021-02-20 06:05
How can I get it verified by v1 now? With existing pipeline henceforth consumer pact will always be verified by provider v2 because that's the last commit on provider repository. I know I need to make some ad-hoc changes, but want to know what'll be the best place.

brendan.donegan
2021-02-20 11:10
so ideally v2 should never have been accepted as the ?master? version when it broke the contract, so that is a hole in your process, but i understand it already happened and you?re looking for a way out.

brendan.donegan
2021-02-20 11:10
either you could request the provider to revert the changes

brendan.donegan
2021-02-20 11:10
or run the pact tests against v1 somehow

brendan.donegan
2021-02-20 11:10
maybe locally

brendan.donegan
2021-02-20 11:11
this all depends on your development setup

arindam.datta
2021-02-20 11:17
Reverting is something I'd like to keep away from for now. But I got it now. I also thought same way that I must "somehow" get consumer v2 validated by provider v1 either locally or by triggering provider validation pipeline with v1 commit hash. Thanks for the suggestion @brendan.donegan.

arindam.datta
2021-02-20 11:18
@hiteshpatadia this :point_up: is the situation we got ourselves into.

brendan.donegan
2021-02-20 11:19
Personally i think it would be nice if Pact had some logic to auto-validate contracts that are not the same per se but are valid together

arindam.datta
2021-02-20 11:20
Though in ideal situation we'd never change master directly and only merge PR when verification (for provider) and can-i-deploy (for consumer) are successful.

brendan.donegan
2021-02-20 11:20
so if v2 of the consumer doesn?t need the `stock` field then it should be auto-validated against all versions of the provider, even ones that don?t return the `stock` field

brendan.donegan
2021-02-20 11:21
@arindam.datta that?s the current model. really it?s not good development practice to merge code that *known* to be broken

arindam.datta
2021-02-20 11:22
Yes true.

arindam.datta
2021-02-20 11:23
As I said in the very first message that by going against all good practices I got myself into this deadlock.

matt.fellows
2021-02-20 11:37
> Personally i think it would be nice if Pact had some logic to auto-validate contracts that are not the same per se but are valid together > I think these things are possible but requires some magic on the way it works today. In our new bi-directional contracts feature (starting with OAS) this is possible. A consumer can publish brand new expectations that the broker has never seen, but if they are a subset of what the provider has already validated (in this case a OAS) it sails thru

matt.fellows
2021-02-20 11:40
I think something like this with pact only contracts would be nice

brendan.donegan
2021-02-20 11:52
sounds neat

chitra.adikesavan
2021-02-20 15:50
has joined #pact-broker

bethskurrie
2021-02-21 04:03
@arindam.datta the consumer/provider has to deploy the change to production before the other one can merge.

bethskurrie
2021-02-21 04:04
This is not a problem introduced by Pact - it's a reality that is highlighted by the use of Pact.

bethskurrie
2021-02-21 04:05
Pre-pact, if you removed the column presence/usage in both sides, and then deployed them together to a test environment, the integration tests would pass.

bethskurrie
2021-02-21 04:06
If one side then deployed to production, before the other one did, it would have silently broken the integration, and you either wouldn't notice, and there would be corrupted data, or there would be a defect raised in production until the other side was deployed.

bethskurrie
2021-02-21 04:07
So you are left with either coupled deployments (which negates the whole point of microservices) or you are left with following the "expand/contract" aka "always backwards compatible with production versions" sequence of changes that Pact will help you achieve.

bethskurrie
2021-02-21 04:09
> ideally v2 should never have been accepted as the ?master? version when it broke the contract Yes, this. The only changes that go into master should be ones that are backwards compatible with the production version of the other. Otherwise, you're back in coupled-deployments world.

bethskurrie
2021-02-21 04:10
It might feel like you're bumping into blocked paths every time can-i-deploy fails, but it's sending you a valid message.

bethskurrie
2021-02-21 04:14
If they're both the same, then the only thing you can really say is "something happened"! You probably want different messages.

ankita.soni
2021-02-22 07:26
has joined #pact-broker

jacek.helper
2021-02-22 08:03
has joined #pact-broker

yann.courtel
2021-02-22 09:07
Hi Arindam, we had that conversation many times in our organization when we have a couple of hundred services with PACTs. The point here is that you need to be flexible enough to allow changes to happen so the PACT deadlock doesn't happen. On our side, we decided to be restrictive on the provider side at build time but to not block the consumer side (just a warning) when we trigger a provider build. That way you can still fix the situation with a half validated contract... Hope that makes sense and can help you. Good luck.

siddharth.gupta
2021-02-22 13:33
Hey folks , i was socializing Pact with engineering teams. one question that came out is how do we inform Consumers early and technically of APIs that are planned to be depreciated in incoming releases and encourage them not to use it . This is one of the major questions coming out from the socialization sessions with engineering teams .

brendan.donegan
2021-02-22 13:37
I wouldn?t say this is the purpose of Pact (maybe something like this is planned though). Here you just use good old fashioned documentation and communication

brendan.donegan
2021-02-22 13:38
Pact is more to make sure you don?t finally remove that API when not all consumers are ready for the change

siddharth.gupta
2021-02-22 13:43
thanks for the reply , we already have some versions of provider released . I still believe there could be a technical mechanism to notify consumers of APIs planned to be deprecated . For example some tagging mechanism or some notification mechanism within Pact to inform consumers .

brendan.donegan
2021-02-22 13:54
I can?t really comment on what?s planned but I kind of get the feeling that deprecation model is somewhat defeating the purpose of Pact

brendan.donegan
2021-02-22 13:54
Because with Pact you should be able to make a version of your consumer that just removes the field, and find out all the consumers that might be broken by that, with 100% accuracy

siddharth.gupta
2021-02-22 14:00
ok so if I get it right , we can intentionally break the test by modifying\failing the API to be deprecated. But I still believe there should already be a smoother technical mechanism to notify consumers .

seanw122
2021-02-22 15:36
has joined #pact-broker

akennedy
2021-02-22 15:54
has joined #pact-broker

esimpson
2021-02-22 16:42
has joined #pact-broker

dagrawal
2021-02-22 17:24
has joined #pact-broker

ryanlevell
2021-02-22 17:33
On docker v2.78.1.1 I do not see the red/green verification results on the matrix page (home page shows colors correctly). Background is just white. Is anyone else experiencing this?

ryanlevell
2021-02-22 17:54
(Removed)

ryanlevell
2021-02-22 17:54
(Removed)

venkata.pro
2021-02-22 21:47
has joined #pact-broker

matt.fellows
2021-02-22 22:49
so yeah, you can intentially break things on the provider side to see how things impact consumers, but Pact won?t let you release that breaking change of course

matt.fellows
2021-02-22 22:49
As far as deprecations go, we?ve been thinking about this in Pactflow. We have just released our provider driven (bi-directional contracts) flow which lets a provider publish an OAS. This baseline feature enables us to build a number of workflows not previously available to us.

matt.fellows
2021-02-22 22:50
Deprecations may be one of them, but right now, we don?t have first class support for doing it, as Brendan mentioned

bethskurrie
2021-02-23 00:27
@ryanlevell I recently upgraded bootstrap and may have broken something. Are you still seeing the issue?

bethskurrie
2021-02-23 00:27
Have you done a force reload of the page?


bethskurrie
2021-02-23 00:28
Feel free to vote on this @siddharth.gupta

matt.fellows
2021-02-23 00:29
Nice one Beth!!

ryanlevell
2021-02-23 01:40
Yes I tried incognito and still seeing it.

jordan.levin
2021-02-23 19:14
has joined #pact-broker

francesco.latorre
2021-02-24 05:59
has joined #pact-broker

aniket.g2185
2021-02-24 09:13
has joined #pact-broker

sundaresank360
2021-02-24 12:12
has joined #pact-broker

jhawthor
2021-02-24 15:18
has joined #pact-broker

chris.r.thomas
2021-02-24 16:54
has joined #pact-broker

peter.cook
2021-02-24 17:05
has joined #pact-broker

jayeshguru81
2021-02-24 18:34
has joined #pact-broker

ben.kirberger
2021-02-24 19:16
has joined #pact-broker

bethskurrie
2021-02-25 00:58
@ryanlevell can you raise an issue please in https://github.com/pact-foundation/pact_broker/issues

bethskurrie
2021-02-25 01:02
@stefanos.varsanis the version ordering started out being semantic, but we've deprecated that long ago, and if you have a Pact Broker version from the last few years, it will just be ordering by the creation date of the version resource



bethskurrie
2021-02-25 01:05
@kflo ^^

bethskurrie
2021-02-25 02:22
Does anyone use can-i-deploy with a blue green deployment release process, or for other reasons have multiple versions of a *provider* in the same prod environment at the same time? Please talk to me in a thread here, and tell me about your use case. I'm interested in which deployed version gets undeployed when you deploy a new version. Eg. for most deployments, the previous version gets "undeployed" or overwritten by the new version immediately. With blue green deployments (which I've never done) there's a period of time where there are two versions in prod, and from what I understand, it's not the *previous* version that gets undeployed, it's the one before that (if you're deploying to alternate environments and switching back and forth - I may misunderstand how this works though, and would love clarification).

matt.fellows
2021-02-25 02:42
So with blue green, you have 2 production environments running that you switch between (via DNS, Load Balancers etc.) when deploying. So let?s say that green is currently live (v2/latest), and blue is standby (v1). When you release, you deploy to blue (v3) and then cutover. There is a potential period where both are running simultaneously.

matt.fellows
2021-02-25 02:43
Red/black is a variant of the above, except that you always tear down the stack that?s no longer live (usually to save costs, but also to avoid drift associated with long running instances etc.)

matt.fellows
2021-02-25 02:44
blue/green is often just meant to mean ?no downtime deploys? and the specific implementation could change (e.g. kubernetes/docker can change the how here) Canarying and traffic shifting is where you gradually send traffic to the new environment, and gradually increase until you?re confident in the change.

matt.fellows
2021-02-25 02:45
(brb meeting)

bethskurrie
2021-02-25 02:53
Thanks Matt.

abubics
2021-02-25 03:44
I think there are many variants of blue/green or red/black zero-downtime deploys, where different-sized sets of resources are deployed/undeployed, e.g. ? scale up an ASG or Fargate cluster, ? deploy a whole new scaling group, ? etc. Then whether you keep the new or the old depends on some kind of smoke tests, whether canary, or test suite, or whatever.

abubics
2021-02-25 03:44
Is the question targeting situations where both old & new are running together for a longer period? Or anything where they may both get traffic, however short the window?

bethskurrie
2021-02-25 03:56
I'm after feedback on what which pacts should be included for the new "auto select pacts" feature described here: https://github.com/pact-foundation/pact_broker/discussions/391

bethskurrie
2021-02-25 03:57
@antonello @phil.endsley @abubics @tjones

bethskurrie
2021-02-25 03:57
@mateusz.derks

bethskurrie
2021-02-25 03:59
@sagupta sorry, I never saw this. "consumer" is a supported field in the consumer version selectors object.

bethskurrie
2021-02-25 03:59
@yann.courtel

bethskurrie
2021-02-25 04:01
@yousafn

bethskurrie
2021-02-25 04:03
@philipchardwick

m.stephkan
2021-02-25 05:30
has joined #pact-broker

stephen.tjasink
2021-02-25 08:23
has joined #pact-broker

antonello
2021-02-25 10:59
We use blue/green deployment. Our current approach is to remove the `prod` tag from version we?re flipping from and add it to the version we?re flipping to. This has always been considered a compromise, because we have multiple ASGs, and we don?t flip them all in one go. Although almost always they?re all flipped within seconds from each other.

yousafn
2021-02-25 19:00
I will have a good read and put the thinking cap on this weekend. First takeaway from reading is anything to lower the barrier of entry especially when it comes to design decisions that have long standing ramifications ( a bad choice of versioning ) so there is a lot for a champion or a few in a org to get right whilst trying to get buy in from the wider org. Would we need to be backwards compatible for older users not wanting the new func and how can we ensure that when we release a new image and an older user updates their PB, that they have a seamless transition.

beatrizwaclawek
2021-02-25 20:27
has joined #pact-broker

zhoutianli1234
2021-02-25 21:09
has joined #pact-broker

bethskurrie
2021-02-26 00:01
@yousafn all existing functionality would still work exactly the same way.

bethskurrie
2021-02-26 00:03
There would be an explicit setting that would need to be configured for the broker to choose the "best practise" pacts for you, and all the rest of the features would now be considered "advanced".

bethskurrie
2021-02-26 00:04
eg. instead of the current recommended configuration which is documented here https://docs.pact.io/provider/recommended_configuration#verification-triggered-by-provider-change : ```consumerVersionSelectors: [ { tag: "main", latest: true }, { tag: process.env.GIT_BRANCH, latest: true }, { tag: "test", latest: true }, { tag: "production", latest: true } ], enablePending: true, includeWipPactsSince: process.env.GIT_BRANCH === "main" ? "2020-01-01" : undefined,```

bethskurrie
2021-02-26 00:04
we would have:

bethskurrie
2021-02-26 00:04
```{ autoSelect: true }```

bethskurrie
2021-02-26 00:04
Or in JVM, `@PactBrokerAutoSelectPacts`

travis.day
2021-02-26 04:06
has joined #pact-broker

young
2021-02-26 09:52
Hi team, when I update the pact_broker client to 1.36.0 , publishing the pacts to the broker was failed: ```#!/bin/bash -eo pipefail pact-broker publish --consumer-app-version ${CIRCLE_SHA1} --tag ${CIRCLE_BRANCH} -b ${PACT_BROKER_URL} -u ${PACT_BROKER_USERNAME} -p ${PACT_BROKER_PASSWORD} ./Pacts /opt/circleci/.rvm/gems/ruby-2.3.1/gems/pact_broker-client-1.36.0/lib/pact_broker/client/cli/broker.rb:224:in `publish_pacts': undefined method `compact' for #<Hash:0x00000003181020> (NoMethodError) from /opt/circleci/.rvm/gems/ruby-2.3.1/gems/pact_broker-client-1.36.0/lib/pact_broker/client/cli/broker.rb:64:in `publish' from /opt/circleci/.rvm/gems/ruby-2.3.1/gems/thor-1.1.0/lib/thor/command.rb:27:in `run' from /opt/circleci/.rvm/gems/ruby-2.3.1/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command' from /opt/circleci/.rvm/gems/ruby-2.3.1/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch' from /opt/circleci/.rvm/gems/ruby-2.3.1/gems/thor-1.1.0/lib/thor/base.rb:485:in `start' from /opt/circleci/.rvm/gems/ruby-2.3.1/gems/pact_broker-client-1.36.0/lib/pact_broker/client/cli/custom_thor.rb:15:in `start' from /opt/circleci/.rvm/gems/ruby-2.3.1/gems/pact_broker-client-1.36.0/bin/pact-broker:4:in `<top (required)>' from /opt/circleci/.rvm/gems/ruby-2.3.1/bin/pact-broker:23:in `load' from /opt/circleci/.rvm/gems/ruby-2.3.1/bin/pact-broker:23:in `<main>' from /opt/circleci/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval' from /opt/circleci/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>' Exited with code exit status 1 CircleCI received exit code 1```

young
2021-02-26 09:53
But when i downgrade to 1.35.0, it worked fine

young
2021-02-26 10:02
and this is my command: ```pact-broker publish --consumer-app-version ${CIRCLE_SHA1} --tag ${CIRCLE_BRANCH} -b ${PACT_BROKER_URL} -u ${PACT_BROKER_USERNAME} -p ${PACT_BROKER_PASSWORD} ./Pacts```

andrew.cunningham
2021-02-26 11:13
has joined #pact-broker

andrew.cunningham
2021-02-26 11:54
@andrew.cunningham has left the channel

brianmasschaele
2021-02-27 13:27
has joined #pact-broker

pedroefajardo_pactio
2021-02-27 17:18
has joined #pact-broker

bethskurrie
2021-02-28 21:37
@young fix has been released.

bethskurrie
2021-02-28 22:50
@antonello I'll have to get you to test out the new `record-deployment` and `record-undeployment` commands. That's exactly the kind of slightly more complex scenario I was trying to work out if there would be a better way to support.

bethskurrie
2021-02-28 23:08
Glad you worked it out @ryanlevell

ryanlevell
2021-02-28 23:25
@bethskurrie sorry, didn?t get to this. But just downloaded 2.79.0.0 and looks good! Thanks for the fix.

young
2021-03-01 01:40
@bethskurrie Thanks

dominic_herrmann
2021-03-01 06:54
has joined #pact-broker

antonello
2021-03-01 07:02
That would be great! I have been pretty busy with other things, so I haven?t been following too closely, but I can get the gist. M

arindam.datta
2021-03-02 08:06
I added few users on PactFlow. One of them didn't receive email with temporary password. How can I make sure that the person receives the email? I don't see any delete user option, otherwise I could delete the user and add again.

matt.fellows
2021-03-02 08:07
Try to re-invite them. If they didn't receive it though it might be in spam

matt.fellows
2021-03-02 08:08
Not much you can do about making sure they receive them, unfortunately email is a bit like that. We use DKIM/SPF/DMARC etc but that doesn't always guarantee delivery

arindam.datta
2021-03-02 08:14
Hi @matt.fellows, already verified that the email is not even in Spam/Junk. Not sure how to re-invite as the User is already added to the Users list and I don't see any option to delete. However, I've tried to Invite the same user again ( ignoring the fact that the user was already added) and hope that the person gets an email now.

matt.fellows
2021-03-02 08:20
Yep that's an undocumented trick that should try to restart that process

arindam.datta
2021-03-02 08:20
Okay.. thanks for your reply @matt.fellows :thumbsup:

matt.fellows
2021-03-02 08:29
Drop an email to with the details if you're still having issues and we can did deeper there

matthew.long
2021-03-02 14:08
has joined #pact-broker

tmoncm
2021-03-02 17:17
has joined #pact-broker

thanuxxxx
2021-03-02 20:53
I set `PACT_BROKER_ALLOW_PUBLIC_READ=true` which makes to verify provider side without having any authentication. Do I still need auths to publish the results back to broker?

thanuxxxx
2021-03-02 20:59
~I got the answer. I don't need any auth to publish the results back~

matt.fellows
2021-03-02 21:20
I think the answer is yes

matt.fellows
2021-03-02 21:21
Publishing is not a read only operation

thanuxxxx
2021-03-02 21:21
Yeah, that's right

thanuxxxx
2021-03-02 21:22
Is that a way to pass pact credentials only for publishing the results?

matt.fellows
2021-03-02 21:23
What are you trying to do exactly

matt.fellows
2021-03-02 21:25
I can't see why you couldn't conditionally add creds tho

phoenixcampos01
2021-03-02 21:25
has joined #pact-broker

matt.fellows
2021-03-02 21:25
But it sounds strange

thanuxxxx
2021-03-02 21:29
Since I set PACT_BROKER_ALLOW_PUBLIC_READ=true, I don't need a credentials to verify provider side of my pact tests. That's works fine. The problem is I have a code block like this to publish the results back to broker ``` private static final String PACT_VERIFIER_PUBLISH_RESULTS_KEY = "pact.verifier.publishResults"; private static final String PACT_VERIFIER_PUBLISH_RESULTS_VALUE = "true"; private static final String PACT_PROVIDER_VERSION_KEY = "pact.provider.version"; private static final String PACT_PROVIDER_TAG_KEY = "pact.provider.tag"; private static final String PACT_PROVIDER_VERSION_GIT_COMMAND = "git rev-parse HEAD"; private static final String PACT_PROVIDER_BRANCH_GIT_COMMAND = "git rev-parse --abbrev-ref HEAD"; @BeforeEach public void setAdditionalPactProperties() throws IOException, InterruptedException { System.setProperty(PACT_VERIFIER_PUBLISH_RESULTS_KEY, PACT_VERIFIER_PUBLISH_RESULTS_VALUE); System.setProperty(PACT_PROVIDER_TAG_KEY, PactTestContext.getGitDetails(PACT_PROVIDER_BRANCH_GIT_COMMAND)); System.setProperty(PACT_PROVIDER_VERSION_KEY, PactTestContext.getGitDetails(PACT_PROVIDER_VERSION_GIT_COMMAND)); }```

thanuxxxx
2021-03-02 21:30
Because I removed those credentials I am planning to do something like this ```stage ('Build') { steps { sh './mvnw clean verify -Dpact.provider.version=${GIT_COMMIT} -Dpact.verifier.publishResults=true' } }```

matt.fellows
2021-03-02 21:31
You'd need to ask in pact JVM channel for clearer advice. I'd be wrapping the system property set operationa in an if/else, setting them outside of the script and in the maven/gradle file, or in the environment itself

thanuxxxx
2021-03-02 21:31
How can I pass the credentials

matt.fellows
2021-03-02 21:32
Now you're asking for Jenkins specific stuff, sorry I can't much there!

ryanlevell
2021-03-03 01:19
`pactbroker.auth.username` and `pactbroker.auth.password` . One way to pass the credentials safely is using the Jenkins credentials store, then the credentials can be safely accessed with the `withCredentials` block via environment variables (if using pipelines). https://www.jenkins.io/doc/pipeline/steps/credentials-binding/ I don?t use the system properties directly as you are, I am using the surefire plugin to pass the system properties as part of the maven `test` phase. But I am using the `withCredentials` to keep the credentials secure. I trigger this conditionally (on jenkins only) by putting the surefire plugin in a maven profile that is only activated when the credentials are present.

thanuxxxx
2021-03-03 01:32
Yeah, that would work

ryanlevell
2021-03-03 01:36
You could do something similar in `@BeforeEach`. ```// PB_USERNAME comes from withCredentials (name it what ever you want) if(System.getenv("PB_USERNAME") != null) { // set credentials & publish to true }```

thanuxxxx
2021-03-03 01:39
This is a spring boot project and I have this in to my properties file. ```pactbroker.auth.username=${PACT_BROKER_USERNAME} pactbroker.auth.password=${PACT_BROKER_PASSWORD}``` I just need to use `withCredentials` and set those variables

ryanlevell
2021-03-03 01:40
Yeah looks like that should work.

hugh.paul.mcgowan
2021-03-03 17:52
has joined #pact-broker

arindam.datta
2021-03-04 05:04
Getting this response from `stub` url on `PactFlow`. Seems something wrong

matt.fellows
2021-03-04 05:11
What?s the pact file look like for that stub?

arindam.datta
2021-03-04 06:57
Pact file looks like this

matt.fellows
2021-03-04 06:58
It only supports post, you need to add your request path to the end of it and use the right http method

arindam.datta
2021-03-04 07:02
Sorry, I didn't understand. Can you please elaborate little bit? This file was generated by Consumer test. Do I need to do something additional in the Consumer Test itself?

matt.fellows
2021-03-04 07:03
Your consumer test is fine

matt.fellows
2021-03-04 07:03
How are you expecting the stub to work?

matt.fellows
2021-03-04 07:04
You were issuing a get request to the stub of your contract, but there is no GET in your contract. You also need to append your interaction path to the stub when calling it

matt.fellows
2021-03-04 07:04
See the docs for more

arindam.datta
2021-03-04 07:04
Aah okk... I'll check and will get back..

matt.fellows
2021-03-04 07:05
Ie `.../stub/your/path/`

matt.fellows
2021-03-04 07:06
Most contracts have multiple interactions in them so you need a way to find the specific interaction to stub. after the stub path it looks at the method the headers, the path and the body and uses that to work out which interaction to return

irldev
2021-03-04 07:49
Hello, I have a question about webhooks on the pact broker. We have a provider that has a few consumers however when I created a webhook for one of the contracts, it seemed to create a webhook for both consumers of that provider. I may have done it wrong but I used the non-get function in the Hal browser for pb:webhooks to create it. Should I have used the non-get function for pb:webhook (singular)? I'm not sure what the difference is between pb:webhooks and pb:webhook.

matt.fellows
2021-03-04 07:51
If you omit the consumer name when creating the webhook it will fire for all consumers of the specified provider

matt.fellows
2021-03-04 07:52
I can't remember the correct relation to use off the top of my head though

normanrs
2021-03-04 11:18
has joined #pact-broker

jayson.bailey
2021-03-04 19:18
has joined #pact-broker

matt.fellows
2021-03-07 02:05
@sagupta :wave: just wondering if you had any experience to share with Gitlab using our CLI tools?

matt.fellows
2021-03-07 02:05
Somebody is having an issue running the container: https://github.com/pact-foundation/pact-ruby-standalone/issues/64

sagupta
2021-03-07 17:25
Hey @matt.fellows Thanks for tagging me

sagupta
2021-03-07 17:26
Yes we use Gitlab in my company and i have experienced many errors while trying to setup the pact workflow. I have reproduced the issue and suggested the solution in the issue comment :slightly_smiling_face:

sagupta
2021-03-07 17:27
Let me know or tag me for other gitlab issues. Will be very happy to help

matt.fellows
2021-03-07 21:12
Thank you so much, this was very helpful. hopefully they are unblocked now

mjsmcp
2021-03-08 23:46
has joined #pact-broker